diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-11-09 21:56:38 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-11-09 21:56:38 -0800 |
commit | 4570284ce14c9f00114039e9b619584a8cad6a50 (patch) | |
tree | 19272f64cbaa24b23f4b481a23eba53cd622bc97 /test | |
parent | 5c168c7e7f73d400db45980115dedab4deefcda7 (diff) | |
download | ruby-4570284ce14c9f00114039e9b619584a8cad6a50.tar.gz |
Test opt_invokebuiltin_delegate_leave in test_jit
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_jit.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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) |