From 4570284ce14c9f00114039e9b619584a8cad6a50 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 9 Nov 2019 21:56:38 -0800 Subject: Test opt_invokebuiltin_delegate_leave in test_jit --- test/ruby/test_jit.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby/test_jit.rb') diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index a4c3e32218..75d4b28d5d 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -20,6 +20,9 @@ class TestJIT < Test::Unit::TestCase # not supported yet :defineclass, :opt_call_c_function, + + # never used + :opt_invokebuiltin_delegate, ].each do |insn| if !RubyVM::INSTRUCTION_NAMES.include?(insn.to_s) warn "instruction #{insn.inspect} is not defined but included in TestJIT::TEST_PENDING_INSNS" @@ -606,6 +609,12 @@ class TestJIT < Test::Unit::TestCase assert_eval_with_jit('print [0].pack("c")', stdout: "\x00", success_count: 1) end + def test_compile_insn_opt_invokebuiltin_delegate_leave + insns = collect_insns(RubyVM::InstructionSequence.of("\x00".method(:unpack)).to_a) + mark_tested_insn(:opt_invokebuiltin_delegate_leave, used_insns: insns) + assert_eval_with_jit('print "\x00".unpack("c")', stdout: '[0]', success_count: 1) + 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) -- cgit v1.2.3