summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-28 14:16:53 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-28 14:16:53 +0000
commit4e12051fe885f93eb5ce8eb114f6ee944b417035 (patch)
treef0a89c73405cd47ce4ad83f3af32a91cccd57221 /test
parent4913edde489968e76956e279f60bad5a374cd817 (diff)
merge revision(s) a6a26e42b15c46f117f4fce07a2050e9d727355d: [Backport #15906]
compile.c: Partially revert r63870 which caused wrong optimization [Bug #15906] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_optimization.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index 5609602c1a..bc3eacce52 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -795,6 +795,21 @@ class TestRubyOptimization < Test::Unit::TestCase
assert_equal(:ok, x.bug(:ok))
end
+ def test_jump_elimination_with_optimized_out_block_2
+ x = Object.new
+ def x.bug
+ a = "aaa"
+ ok = :NG
+ if a == "bbb" || a == "ccc" then
+ a = a
+ else
+ ok = :ok
+ end
+ ok
+ end
+ assert_equal(:ok, x.bug)
+ end
+
def test_peephole_jump_after_newarray
i = 0
%w(1) || 2 while (i += 1) < 100