summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-10-25 21:30:16 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-10-25 21:30:16 +0900
commit1c0c8d5da2abc84a56ca4b66b73e0c262df0fbbe (patch)
tree8be148511f36c78cbbacfd645c50ddc327c4e929 /test
parent5bcef26d24fdd5756d2678aca03190d03a82ad9a (diff)
test/ruby/test_jit.rb: Add a test for checkmatch insn
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_jit.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index b1bef2a7b7..669dcf56e6 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -609,6 +609,17 @@ class TestJIT < Test::Unit::TestCase
assert_eval_with_jit('print "\x00".unpack("c")', stdout: '[0]', success_count: 1)
end
+ def test_compile_insn_checkmatch
+ assert_compile_once("#{<<~"begin;"}\n#{<<~"end;"}", result_inspect: '"world"', insns: %i[checkmatch])
+ begin;
+ ary = %w(hello good-bye)
+ case 'hello'
+ when *ary
+ 'world'
+ end
+ end;
+ end
+
def test_jit_output
out, err = eval_with_jit('5.times { puts "MJIT" }', verbose: 1, min_calls: 5)
assert_equal("MJIT\n" * 5, out)