diff options
| author | Stan Lo <stan001212@gmail.com> | 2025-12-01 17:14:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-01 17:14:08 +0000 |
| commit | c58970b57a91a10eb75f933258643d0393ce0ba8 (patch) | |
| tree | 2e60bf50b418b2e07d121ad6a61f1f17fc331f1d /test/ruby | |
| parent | 8dc5822b007937f75eb0b156c9d9dcc7b16f9de8 (diff) | |
ZJIT: Optimize variadic cfunc `Send` calls into `CCallVariadic` (#14898)
ZJIT: Optimize variadic cfunc Send calls into CCallVariadic
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_zjit.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 7472ff7715..d821d8ad5c 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -525,6 +525,21 @@ class TestZJIT < Test::Unit::TestCase } end + def test_send_variadic_with_block + assert_compiles '[[1, "a"], [2, "b"], [3, "c"]]', %q{ + A = [1, 2, 3] + B = ["a", "b", "c"] + + def test + result = [] + A.zip(B) { |x, y| result << [x, y] } + result + end + + test; test + }, call_threshold: 2 + end + def test_send_splat assert_runs '[1, 2]', %q{ def test(a, b) = [a, b] |
