ruby-changes:69072
From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:45 +0900 (JST)
Subject: [ruby-changes:69072] 6aa4637272 (master): Fix and uncomment getlocal test
https://git.ruby-lang.org/ruby.git/commit/?id=6aa4637272 From 6aa4637272204b7017a0414393ab05be6fa07672 Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Tue, 20 Jul 2021 10:22:08 -0700 Subject: 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. --- test/ruby/test_yjit.rb | 27 +++++++++++++-------------- 1 file 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_yjit.rb#L55 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) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/