summaryrefslogtreecommitdiff
path: root/test/ruby/test_zjit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_zjit.rb')
-rw-r--r--test/ruby/test_zjit.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index fdcee3cafd..299600eef9 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -999,6 +999,26 @@ class TestZJIT < Test::Unit::TestCase
}, call_threshold: 2
end
+ def test_profile_under_nested_jit_call
+ assert_compiles '[nil, nil, 3]', %q{
+ def profile
+ 1 + 2
+ end
+
+ def jit_call(flag)
+ if flag
+ profile
+ end
+ end
+
+ def entry(flag)
+ jit_call(flag)
+ end
+
+ [entry(false), entry(false), entry(true)]
+ }, call_threshold: 2
+ end
+
def test_bop_redefinition
assert_runs '[3, :+, 100]', %q{
def test