diff options
author | Takashi Kokubun <[email protected]> | 2025-06-04 17:14:40 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2025-06-04 14:14:40 -0700 |
commit | 112c34252d15d94bff87241ade18badc09923b09 (patch) | |
tree | 2f7d64152bc57ee0521391d145ac557dda6ad7bd /test | |
parent | 99cc100cdf4f424faea8caa33beb0d14171c5dcb (diff) |
ZJIT: Implement side exits for entry frames (#13469)
Co-authored-by: Max Bernstein <[email protected]>
Co-authored-by: Alan Wu <[email protected]>
Notes
Notes:
Merged-By: k0kubun <[email protected]>
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_zjit.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 796851a9bf..aba05ddebd 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -94,6 +94,24 @@ class TestZJIT < Test::Unit::TestCase }, call_threshold: 2 end + def test_opt_plus_type_guard_exit + assert_compiles '[3, 3.0]', %q{ + def test(a) = 1 + a + test(1) # profile opt_plus + [test(2), test(2.0)] + }, call_threshold: 2 + end + + def test_opt_plus_type_guard_nested_exit + omit 'rewind_caller_frames is not implemented yet' + assert_compiles '[3, 3.0]', %q{ + def side_exit(n) = 1 + n + def jit_frame(n) = 1 + side_exit(n) + def entry(n) = jit_frame(n) + [entry(2), entry(2.0)] + }, call_threshold: 2 + end + # Test argument ordering def test_opt_minus assert_compiles '2', %q{ |