summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-03-01 10:03:00 -0800
committerGitHub <noreply@github.com>2024-03-01 13:03:00 -0500
commit661f9e6d03d04667b5488ec202c0e1ec6f97c080 (patch)
tree4bdf846b768d841be1237274c0e8590981391e84 /test
parent88050ec179b2327d4b99d08fc0d825fc8898f5a7 (diff)
YJIT: Support opt_invokebuiltin_delegate for leaf builtin (#10152)
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_yjit.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index 8936e567d1..67e684656d 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -1600,6 +1600,19 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
+ def test_leaf_builtin
+ assert_compiles(code_gc_helpers + <<~'RUBY', exits: :any, result: 1)
+ before = RubyVM::YJIT.runtime_stats[:num_send_iseq_leaf]
+ return 1 if before.nil?
+
+ def entry = self.class
+ entry
+
+ after = RubyVM::YJIT.runtime_stats[:num_send_iseq_leaf]
+ after - before
+ RUBY
+ end
+
private
def code_gc_helpers