mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 11:33:58 +02:00
Implement invokebuiltin
This commit is contained in:
parent
6055078b24
commit
9951a9a8ec
3 changed files with 60 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue