ZJIT: Fix "immediate value too large" on cmp for x86_64 (#14125)

Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
This commit is contained in:
Takashi Kokubun 2025-08-06 10:05:20 -07:00 committed by GitHub
parent bcd21053f7
commit ebb775be8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 4 deletions

View file

@ -283,6 +283,14 @@ class TestZJIT < Test::Unit::TestCase
}, insns: [:opt_eq], call_threshold: 2
end
def test_opt_eq_with_minus_one
assert_compiles '[false, true]', %q{
def test(a) = a == -1
test(1) # profile opt_eq
[test(0), test(-1)]
}, insns: [:opt_eq], call_threshold: 2
end
def test_opt_neq_dynamic
# TODO(max): Don't split this test; instead, run all tests with and without
# profiling.