summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2025-06-06 21:51:05 +0900
committerAlan Wu <[email protected]>2025-06-09 22:36:53 +0900
commit9865aa94f7de65cd8c4964c13960ca9299cbdd48 (patch)
tree1c847ac0bf5b84acd53ba82c797970ce96ff60b8 /test
parent96fdaf2e393933fdd128cd1a41fa9b2062792a15 (diff)
ZJIT: Parse opt_empty_p into HIR
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13549
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_zjit.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 3b64887f92..8771a31754 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -205,6 +205,13 @@ class TestZJIT < Test::Unit::TestCase
}, insns: [:opt_gt], call_threshold: 2
end
+ def test_opt_empty_p
+ assert_compiles('[false, false, true]', <<~RUBY, insns: [:opt_empty_p])
+ def test(x) = x.empty?
+ return test([1]), test("1"), test({})
+ RUBY
+ end
+
def test_opt_ge
assert_compiles '[false, true, true]', %q{
def test(a, b) = a >= b