diff options
author | John Hawthorn <john@hawthorn.email> | 2021-07-20 10:22:08 -0700 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:38 -0400 |
commit | 6aa4637272204b7017a0414393ab05be6fa07672 (patch) | |
tree | 13e275f4ccc8472291123cbcc00985cf6e5a471d /test/ruby | |
parent | 1891dcaa9faee3684d6c8abfc34cab5b01a63632 (diff) |
Fix and uncomment getlocal test
Previously, under the scraper, this would side-exit because it was
returning to a C method. Now that we use the jit_func entrypoint, this
test no longer side-exits.
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_yjit.rb | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 4f93ddd65f..8b61a1dbfc 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -55,20 +55,19 @@ class TestYJIT < Test::Unit::TestCase assert_compiles('-"foo" == -"bar"', insns: %i[opt_eq], result: false) end - # FIXME: currently not working - #def test_getlocal_with_level - # assert_compiles(<<~RUBY, insns: %i[getlocal opt_plus], result: [[7]], exits: {leave: 2}) - # def foo(foo, bar) - # [1].map do |x| - # [1].map do |y| - # foo + bar - # end - # end - # end - # - # foo(5, 2) - # RUBY - #end + def test_getlocal_with_level + assert_compiles(<<~RUBY, insns: %i[getlocal opt_plus], result: [[7]]) + def foo(foo, bar) + [1].map do |x| + [1].map do |y| + foo + bar + end + end + end + + foo(5, 2) + RUBY + end def test_string_then_nil assert_compiles(<<~RUBY, insns: %i[opt_nil_p], result: true) |