ruby-changes:69054
From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:41 +0900 (JST)
Subject: [ruby-changes:69054] 4040ca8293 (master): more testing
https://git.ruby-lang.org/ruby.git/commit/?id=4040ca8293 From 4040ca82938445f8c1959c5b1e8619803ff78b1b Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Fri, 25 Jun 2021 23:50:19 -0700 Subject: more testing --- test/ruby/test_yjit.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 8b87b55690..4c3889a3f7 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -55,6 +55,20 @@ 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], stdout: 'false') end + def test_getlocal_with_level + assert_compiles(<<~RUBY, insns: %i[getlocal opt_plus], stdout: '[[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_string_then_nil assert_compiles(<<~RUBY, insns: %i[opt_nil_p], stdout: 'true') def foo(val) @@ -112,8 +126,8 @@ class TestYJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_yjit.rb#L126 RUBY end - def test_recursion - assert_compiles(<<~'RUBY', insns: %i[opt_le opt_minus opt_plus], stdout: '34') + def test_fib_recursion + assert_compiles(<<~'RUBY', insns: %i[opt_le opt_minus opt_plus opt_send_without_block], stdout: '34') def fib(n) return n if n <= 1 fib(n-1) + fib(n-2) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/