summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2025-06-06 22:00:17 +0900
committerAlan Wu <[email protected]>2025-06-09 22:36:53 +0900
commit1c43f7e9668b841f8976b32c60c3ce6b2aeffc23 (patch)
tree9e6d078dac6e08c0f70017c224e00762d800a615 /test
parent4a2480e79a6c1932a06d56035a8e2eb0ba5defca (diff)
ZJIT: Parse opt_and 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 8fe5ae2df9..905ee2f125 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -219,6 +219,13 @@ class TestZJIT < Test::Unit::TestCase
RUBY
end
+ def test_opt_and
+ assert_compiles('[1, [3, 2, 1]]', <<~RUBY, insns: [:opt_and])
+ def test(x, y) = x & y
+ return test(0b1101, 3), test([3, 2, 1, 4], [8, 1, 2, 3])
+ RUBY
+ end
+
def test_opt_ge
assert_compiles '[false, true, true]', %q{
def test(a, b) = a >= b