summaryrefslogtreecommitdiff
path: root/test/ruby/test_zjit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_zjit.rb')
-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