diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-11-09 21:40:38 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-11-09 21:40:38 -0800 |
commit | 5c168c7e7f73d400db45980115dedab4deefcda7 (patch) | |
tree | 9e6ae3df84029eff369e3f83f307124db3d3ed81 /test/ruby | |
parent | 0483d01f6bdd3d16b31244a7aaadb4c31f6ecee7 (diff) | |
download | bundler-5c168c7e7f73d400db45980115dedab4deefcda7.tar.gz |
Support RB_BUILTIN in ISeq#to_a
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_iseq.rb | 7 | ||||
-rw-r--r-- | test/ruby/test_jit.rb | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 30c4c2815d..0120a50887 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -559,4 +559,11 @@ class TestISeq < Test::Unit::TestCase assert_equal iseq1.object_id, iseq2.object_id } end + + def test_iseq_builtin_to_a + insns = RubyVM::InstructionSequence.of([].method(:pack)).to_a.last + invokebuiltin = insns.find { |insn| insn.is_a?(Array) && insn[0] == :invokebuiltin } + assert_not_nil(invokebuiltin) + assert_equal([:func_ptr, :argc, :index, :name], invokebuiltin[1].keys) + end end diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index bb5727f5fb..a4c3e32218 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -601,8 +601,8 @@ class TestJIT < Test::Unit::TestCase end def test_compile_insn_invokebuiltin - # insns = collect_insns(RubyVM::InstructionSequence.of([0].method(:pack)).to_a) - # mark_tested_insn(:invokebuiltin, used_insns: insns) + insns = collect_insns(RubyVM::InstructionSequence.of([0].method(:pack)).to_a) + mark_tested_insn(:invokebuiltin, used_insns: insns) assert_eval_with_jit('print [0].pack("c")', stdout: "\x00", success_count: 1) end |