summaryrefslogtreecommitdiff
path: root/test/ruby/test_optimization.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-06-07 14:45:06 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-06-07 14:46:59 +0900
commita6a26e42b15c46f117f4fce07a2050e9d727355d (patch)
tree8c0f54f4dd5489eb294443c29ce7f1a06ce16194 /test/ruby/test_optimization.rb
parentb8af33e63bd286308e5e1b20c182ec50e0f194de (diff)
compile.c: Partially revert r63870 which caused wrong optimization
[Bug #15906]
Diffstat (limited to 'test/ruby/test_optimization.rb')
-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 d6649cc958..cb65b3a36b 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