summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorKevin Menard <kevin.menard@shopify.com>2024-04-24 10:31:35 -0400
committerGitHub <noreply@github.com>2024-04-24 10:31:35 -0400
commitafc7799c3271aab7792c178ab9aee15b87468341 (patch)
treeaf5b29d52cb0774ca2bfdf8cc808a96daa1a0d47 /bootstraptest
parent480287d14056ca7366477ad39b944195185a6d7e (diff)
YJIT: Add a specialized codegen function for `Class#superclass`. (#10613)
Add a specialized codegen function for `Class#superclass`. Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com> Co-authored-by: Randy Stauner <randy.stauner@shopify.com> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 2e190a5b9c..216594f6cc 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -4816,3 +4816,19 @@ assert_equal "abc", %q{
change_bytes(str, to_int_1, to_int_99)
str
}
+
+assert_equal '["raised", "Module", "Object"]', %q{
+ def foo(obj)
+ obj.superclass.name
+ end
+
+ ret = []
+
+ begin
+ foo(Class.allocate)
+ rescue TypeError
+ ret << 'raised'
+ end
+
+ ret += [foo(Class), foo(Class.new)]
+}