summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 0c73e6b456..7da5d96d35 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -713,8 +713,7 @@ class TestZJIT < Test::Unit::TestCase
end
def test_spilled_method_args
- omit 'CCall with spilled arguments is not implemented yet'
- assert_compiles '55', %q{
+ assert_runs '55', %q{
def foo(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10)
n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10
end
@@ -906,10 +905,17 @@ class TestZJIT < Test::Unit::TestCase
# Assert that every method call in `test_script` can be compiled by ZJIT
# at a given call_threshold
def assert_compiles(expected, test_script, insns: [], **opts)
+ assert_runs(expected, test_script, insns:, assert_compiles: true, **opts)
+ end
+
+ # Assert that `test_script` runs successfully with ZJIT enabled.
+ # Unlike `assert_compiles`, `assert_runs(assert_compiles: false)`
+ # allows ZJIT to skip compiling methods.
+ def assert_runs(expected, test_script, insns: [], assert_compiles: false, **opts)
pipe_fd = 3
script = <<~RUBY
- ret_val = (_test_proc = -> { RubyVM::ZJIT.assert_compiles; #{test_script.lstrip} }).call
+ ret_val = (_test_proc = -> { #{('RubyVM::ZJIT.assert_compiles; ' if assert_compiles)}#{test_script.lstrip} }).call
result = {
ret_val:,
#{ unless insns.empty?