summaryrefslogtreecommitdiff
path: root/test/ruby/test_zjit.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2025-09-10 08:54:10 -0700
committerGitHub <noreply@github.com>2025-09-10 08:54:10 -0700
commitc0e01a271475ae765fc92e31245e42ea2b2d43f6 (patch)
tree0318198fa11b106a97daba1995879b8b8acdba1d /test/ruby/test_zjit.rb
parent928fea3bfa86053c0bc6f7a5bf7559b115a676b5 (diff)
ZJIT: Compile ISEQs with forwardable parameters (#14491)
Diffstat (limited to 'test/ruby/test_zjit.rb')
-rw-r--r--test/ruby/test_zjit.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 5f59f9fc02..f010995e58 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -439,6 +439,21 @@ class TestZJIT < Test::Unit::TestCase
}, call_threshold: 2
end
+ def test_forwardable_iseq
+ assert_compiles '1', %q{
+ def test(...) = 1
+ test
+ }
+ end
+
+ def test_sendforward
+ assert_runs '[1, 2]', %q{
+ def callee(a, b) = [a, b]
+ def test(...) = callee(...)
+ test(1, 2)
+ }, insns: [:sendforward]
+ end
+
def test_iseq_with_optional_arguments
assert_compiles '[[1, 2], [3, 4]]', %q{
def test(a, b = 2) = [a, b]