1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Test opt_invokebuiltin_delegate_leave in test_jit

This commit is contained in:
Takashi Kokubun 2019-11-09 21:56:38 -08:00
parent 5c168c7e7f
commit 4570284ce1
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -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)