diff options
author | John Hawthorn <[email protected]> | 2021-09-13 14:31:12 -0700 |
---|---|---|
committer | Alan Wu <[email protected]> | 2021-10-20 18:19:41 -0400 |
commit | ba9d01b3cf043d52a80af6fc9c377d6b63062442 (patch) | |
tree | 295fe4c61208a10261521b0ed61bebb926d3b367 /test | |
parent | 121d8f47274d53a013f9306a3e53a6f37e66a8e5 (diff) |
Specialize based on types of opt_aset
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_yjit.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 23a2675be1..cd99924936 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -158,6 +158,13 @@ class TestYJIT < Test::Unit::TestCase assert_no_exits('"i am a string #{true}"') end + def test_compile_opt_aset + assert_compiles('[1,2,3][2] = 4', insns: %i[opt_aset]) + assert_compiles('{}[:foo] = :bar', insns: %i[opt_aset]) + assert_compiles('[1,2,3][0..-1] = []', insns: %i[opt_aset]) + assert_compiles('"foo"[3] = "d"', insns: %i[opt_aset]) + end + def test_compile_attr_set assert_no_exits(<<~EORB) class Foo |