aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-08-18 11:30:52 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2023-08-18 12:17:37 -0400
commit4524aeba2f181df08b68587da140becd2dfa389f (patch)
tree79f6b47af31472d2d82f54157f108dad76672f0e /bootstraptest
parentc8d641998532c29714529e3c2e721bb1499658d5 (diff)
downloadruby-4524aeba2f181df08b68587da140becd2dfa389f.tar.gz
YJIT: Fix return type of Integer#/ with T_FIXNUM inputs
Issue found by running ruby/spec with `--yjit-verify-ctx`. Thanks!
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 5dd244e3be..4f73af89e8 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -1,3 +1,13 @@
+# regression test for return type of Integer#/
+# It can return a T_BIGNUM when inputs are T_FIXNUM.
+assert_equal 0x3fffffffffffffff.to_s, %q{
+ def call(fixnum_min)
+ (fixnum_min / -1) - 1
+ end
+
+ call(-(2**62))
+}
+
# regression test for return type of String#<<
assert_equal 'Sub', %q{
def call(sub) = (sub << sub).itself