summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-07-25 10:20:04 -0700
committerGitHub <noreply@github.com>2023-07-25 13:20:04 -0400
commite1104017e3080fd432c0b5fdc3ae6e004ffd0834 (patch)
treeabc0263836ba8539e7c54a1fd886a7ed9717a871 /test/ruby
parent99162dee7aa478d8a65f028b098bdaa69e1ecad5 (diff)
YJIT: Fix cfp inconsistency on tailcall (#8107)
[Bug #19781]
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_optimization.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index 9ce5371dd0..8d669e502c 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -437,6 +437,20 @@ class TestRubyOptimization < Test::Unit::TestCase
message(bug12565) {disasm(:add_one_and_two)})
end
+ def test_c_func_with_sp_offset_under_tailcall
+ tailcall("#{<<-"begin;"}\n#{<<~"end;"}")
+ begin;
+ def calc_one_plus_two
+ 1 + 2.abs
+ end
+
+ def one_plus_two
+ calc_one_plus_two
+ end
+ end;
+ assert_equal(3, one_plus_two)
+ end
+
def test_tailcall_interrupted_by_sigint
bug12576 = 'ruby-core:76327'
script = "#{<<-"begin;"}\n#{<<~'end;'}"