diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-25 17:19:51 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-25 17:19:51 +0000 |
commit | 08c9f030f6b5d260d12cf02a9ca0f4a60f816365 (patch) | |
tree | 42e5f6136b38effe27dac1617ce5ddd44fac6323 /test | |
parent | 3f4d174c22589ea275f971fab90136add6e456ac (diff) | |
download | ruby-08c9f030f6b5d260d12cf02a9ca0f4a60f816365.tar.gz |
Revert "Revert r64824 to fix build failure on AppVeyor"
This reverts commit r64829. I'll prepare another temporary fix, but I'll
separately commit that to make it easier to revert that later.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_jit.rb | 8 | ||||
-rw-r--r-- | test/ruby/test_optimization.rb | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 50f318c2a7..3770faf038 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -478,6 +478,14 @@ class TestJIT < Test::Unit::TestCase assert_compile_once('[1] << 2', result_inspect: '[1, 2]', insns: %i[opt_ltlt]) end + def test_compile_insn_opt_and + assert_compile_once('1 & 3', result_inspect: '1', insns: %i[opt_and]) + end + + def test_compile_insn_opt_or + assert_compile_once('1 | 3', result_inspect: '3', insns: %i[opt_or]) + end + def test_compile_insn_opt_aref skip_on_mswin # optimized call (optimized JIT) -> send call diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index d4a1fdbcea..c425254661 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -187,6 +187,16 @@ class TestRubyOptimization < Test::Unit::TestCase assert_redefine_method('String', '<<', 'assert_equal "b", "a" << "b"') end + def test_fixnum_and + assert_equal 1, 1&3 + assert_redefine_method('Integer', '&', 'assert_equal 3, 1&3') + end + + def test_fixnum_or + assert_equal 3, 1|3 + assert_redefine_method('Integer', '|', 'assert_equal 1, 3|1') + end + def test_array_plus assert_equal [1,2], [1]+[2] assert_redefine_method('Array', '+', 'assert_equal [2], [1]+[2]') |