summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2025-04-02 09:18:36 -0700
committerTakashi Kokubun <[email protected]>2025-04-18 21:53:01 +0900
commitcfc9234ccdb457934f4daeef599e303844869fc3 (patch)
tree547c2823dce89853ae70d7ccdb16c421f55aaa10 /test/ruby
parentdd44935e8bda014cf3c1d6491b22a9ccac84f093 (diff)
Compile Param into VReg and ParallelMov (https://github.com/Shopify/zjit/pull/87)
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb31
1 files changed, 19 insertions, 12 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 98eae2a58f..7e81193a75 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -348,6 +348,14 @@ class TestZJIT < Test::Unit::TestCase
}
end
+ def test_live_reg_past_ccall
+ assert_compiles '2', %q{
+ def callee = 1
+ def test = callee + callee
+ test
+ }
+ end
+
def test_recursive_fact
assert_compiles '[1, 6, 720]', %q{
def fact(n)
@@ -360,18 +368,17 @@ class TestZJIT < Test::Unit::TestCase
}
end
- # FIXME: currently produces the wrong value
- #def test_recursive_fib
- # assert_compiles '[0, 2, 3]', %q{
- # def fib(n)
- # if n < 2
- # return n
- # end
- # return fib(n-1) + fib(n-2)
- # end
- # [fib(0), fib(3), fib(4)]
- # }
- #end
+ def test_recursive_fib
+ assert_compiles '[0, 2, 3]', %q{
+ def fib(n)
+ if n < 2
+ return n
+ end
+ return fib(n-1) + fib(n-2)
+ end
+ [fib(0), fib(3), fib(4)]
+ }
+ end
private