summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2025-06-05 14:48:04 -0700
committerGitHub <[email protected]>2025-06-05 14:48:04 -0700
commit1a991131a04feb3527f7e4993491b587d2e57179 (patch)
tree1b69cc884013576f53c5b2d7f016afc6e176445c /test/ruby
parent4e39580992064a4e91e9b8626a1a220f262a7011 (diff)
ZJIT: Pass self through basic block params (#13529)
* ZJIT: Pass self through basic block params Co-authored-by: Max Bernstein <[email protected]> * Add comments for self * Use self_param for ivar * Make self_param a loop local * Fix rest parameter type check * Push self_param first * Add a test case for putself * Use SELF_PARAM_IDX Co-authored-by: Max Bernstein <[email protected]> * Fix test_unknown --------- Co-authored-by: Max Bernstein <[email protected]>
Notes
Notes: Merged-By: k0kubun <[email protected]>
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 3d97c92a02..d6fc4ba2f7 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -534,6 +534,17 @@ class TestZJIT < Test::Unit::TestCase
}
end
+ def test_putself
+ assert_compiles '3', %q{
+ class Integer
+ def minus(a)
+ self - a
+ end
+ end
+ 5.minus(2)
+ }
+ end
+
# tool/ruby_vm/views/*.erb relies on the zjit instructions a) being contiguous and
# b) being reliably ordered after all the other instructions.
def test_instruction_order