summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2025-03-11 09:20:58 -0700
committerTakashi Kokubun <[email protected]>2025-04-18 21:52:59 +0900
commitbe8c78f20dd5eaf31d1514319e60d904aad6dbd5 (patch)
tree042975965fe45ec48db1ea8376633821a328853e /test/ruby
parenta7f8beee84f0e59e152214d41976f559f5f79e42 (diff)
Add a skipped test case for opt_mult overflow
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 4c4e837c10..7b6201f4ed 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -81,6 +81,24 @@ class TestZJIT < Test::Unit::TestCase
}, call_threshold: 2
end
+ def test_opt_mult_overflow
+ omit 'side exits are not implemented yet'
+ assert_compiles '[6, -6, 9671406556917033397649408, -9671406556917033397649408, 21267647932558653966460912964485513216]', %q{
+ def test(a, b)
+ a * b
+ end
+ test(1, 1) # profile opt_mult
+
+ r1 = test(2, 3)
+ r2 = test(2, -3)
+ r3 = test(2 << 40, 2 << 41)
+ r4 = test(2 << 40, -2 << 41)
+ r5 = test(1 << 62, 1 << 62)
+
+ [r1, r2, r3, r4, r5]
+ }, call_threshold: 2
+ end
+
def test_opt_eq
assert_compiles '[true, false]', %q{
def test(a, b) = a == b