summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2025-04-03 08:52:20 -0700
committerTakashi Kokubun <[email protected]>2025-04-18 21:53:01 +0900
commitddef6a7ce46ed87e0c58ddaf97f69feeb5d29300 (patch)
tree5b0d39207dd7502f9ee9026b461df39fff6888a1 /test
parentbfe7da019fb6a03c2727acb5e4ad50def91cf917 (diff)
Split LHS of CMP if it's an immediate (https://github.com/Shopify/zjit/pull/94)
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_zjit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index e6f6b16e69..494d474107 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -147,6 +147,14 @@ class TestZJIT < Test::Unit::TestCase
}, call_threshold: 2
end
+ def test_opt_lt_with_literal_lhs
+ assert_compiles '[false, false, true]', %q{
+ def test(n) = 2 < n
+ test(2) # profile opt_lt
+ [test(1), test(2), test(3)]
+ }, call_threshold: 2
+ end
+
def test_opt_le
assert_compiles '[true, true, false]', %q{
def test(a, b) = a <= b