summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-07-08 23:33:55 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:41 -0400
commit9951a9a8ece77ad8aa2a8871b009e2f1fb776987 (patch)
treee0801f5fa4751acb9df44f2222f231051c833781 /test/ruby
parent6055078b24ce9878aafad406fe72711311f9744f (diff)
Implement invokebuiltin
Diffstat (limited to 'test/ruby')
-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 4672e83c9c..ed83bd681a 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -310,6 +310,19 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
+ def test_invokebuiltin
+ assert_compiles(<<~RUBY)
+ def foo(obj)
+ obj.foo = 123
+ obj.bar = 123
+ end
+
+ Foo = Struct.new(:foo, :bar)
+ foo(Foo.new(123))
+ foo(Foo.new(123))
+ RUBY
+ end
+
def test_super_iseq
assert_compiles(<<~'RUBY', insns: %i[invokesuper opt_plus opt_mult], result: 15)
class A