aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-04-03 21:22:02 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2023-04-03 21:26:40 -0700
commit6ab86e462624df5d7d0d7661f9511d05c0363224 (patch)
tree0c05a3fb09b0a146f9ce39465b2536463d7e2339 /bootstraptest
parent1d529f382c4b855d22289990c4369ee68ddd3adc (diff)
downloadruby-6ab86e462624df5d7d0d7661f9511d05c0363224.tar.gz
RJIT: Fix arguments for shift_stack
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_rjit.rb36
1 files changed, 25 insertions, 11 deletions
diff --git a/bootstraptest/test_rjit.rb b/bootstraptest/test_rjit.rb
index c00c742318..a8a1524fe2 100644
--- a/bootstraptest/test_rjit.rb
+++ b/bootstraptest/test_rjit.rb
@@ -1,16 +1,30 @@
-assert_equal 'true', %q{
- def nil_nil = nil == nil
- nil_nil
+# VM_CALL_OPT_SEND + VM_METHOD_TYPE_ATTRSET
+assert_equal '1', %q{
+ class Foo
+ attr_writer :foo
+
+ def bar
+ send(:foo=, 1)
+ end
+ end
+
+ Foo.new.bar
}
-assert_equal 'true', %q{
- def lt(a, b) = a < b
- lt(1, 2)
- lt('a', 'b')
+# VM_CALL_OPT_SEND + OPTIMIZED_METHOD_TYPE_CALL
+assert_equal 'foo', %q{
+ def bar(&foo)
+ foo.send(:call)
+ end
+
+ bar { :foo }
}
-assert_equal '3', %q{
- def foo = 2
- def bar = 1 + foo + nil.to_i
- bar
+# VM_CALL_OPT_SEND + OPTIMIZED_METHOD_TYPE_STRUCT_AREF
+assert_equal 'bar', %q{
+ def bar(foo)
+ foo.send(:bar)
+ end
+
+ bar(Struct.new(:bar).new(:bar))
}