diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-10 13:05:59 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:47:09 -0700 |
commit | ca2afba4a7162ca9bbaa12891da5d55f81752d23 (patch) | |
tree | bc4371b68f810cb24a221a7a6c9e256b7e050e74 /bootstraptest/test_yjit.rb | |
parent | 8c45b8a989fea4c74d68c464a55aa54e9144994a (diff) |
Port the remaining method types in opt_send_without_block (https://github.com/Shopify/ruby/pull/390)
Diffstat (limited to 'bootstraptest/test_yjit.rb')
-rw-r--r-- | bootstraptest/test_yjit.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 833d1393f0..7aed5ac43c 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -3198,3 +3198,25 @@ assert_equal '[1, 2]', %q{ def bar = foo(1) { 2 } bar } + +# opt_send_without_block (VM_METHOD_TYPE_IVAR) +assert_equal 'foo', %q{ + class Foo + attr_reader :foo + + def initialize + @foo = "foo" + end + end + Foo.new.foo +} + +# opt_send_without_block (VM_METHOD_TYPE_OPTIMIZED) +assert_equal 'foo', %q{ + Foo = Struct.new(:bar) + Foo.new("bar").bar = "foo" +} +assert_equal 'foo', %q{ + Foo = Struct.new(:bar) + Foo.new("foo").bar +} |