summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_yjit.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index 19ca75f883..63d752dde4 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -483,6 +483,32 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
+ def test_getblockparam
+ assert_compiles(<<~'RUBY', insns: [:getblockparam])
+ def foo &blk
+ 2.times do
+ blk
+ end
+ end
+
+ foo {}
+ foo {}
+ RUBY
+ end
+
+ def test_getblockparamproxy
+ # Currently two side exits as OPTIMIZED_METHOD_TYPE_CALL is unimplemented
+ assert_compiles(<<~'RUBY', insns: [:getblockparamproxy], exits: { opt_send_without_block: 2 })
+ def foo &blk
+ p blk.call
+ p blk.call
+ end
+
+ foo { 1 }
+ foo { 2 }
+ RUBY
+ end
+
def test_getivar_opt_plus
assert_no_exits(<<~RUBY)
class TheClass