aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorywenc <ywenc@github.com>2023-07-26 10:38:59 -0400
committerGitHub <noreply@github.com>2023-07-26 10:38:59 -0400
commit8ca399d64023fd13bd17bc38132610ccb2ccc598 (patch)
treef2d178cb6184c4a401a08c9a551c9e7b23ef11e1 /bootstraptest
parent786a864900ceee6ed89d7df81698bbbe7e7bd6ae (diff)
downloadruby-8ca399d64023fd13bd17bc38132610ccb2ccc598.tar.gz
Implement `opt_aref_with` instruction (#8118)
Implement gen_opt_aref_with Vm opt_aref_with is available Test opt_aref_with Stats for opt_aref_with Co-authored-by: jhawthorn <jhawthorn@github.com>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 402b5c512a..80d0ef00d8 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -1100,6 +1100,18 @@ assert_equal '[42, :default]', %q{
]
}
+# Test default value block for Hash with opt_aref_with
+assert_equal "false", %q{
+ def index_with_string(h)
+ h["foo"]
+ end
+
+ h = Hash.new { |h, k| k.frozen? }
+
+ index_with_string(h)
+ index_with_string(h)
+}
+
# A regression test for making sure cfp->sp is proper when
# hitting stubs. See :stub-sp-flush:
assert_equal 'ok', %q{