diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2022-12-27 14:56:51 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2022-12-27 14:56:51 +0900 |
commit | 5c551ac59f9620901394a46dffda5a1833b9c4b0 (patch) | |
tree | 9f27c050807ecbfd87264bef9a1214f2fb36a748 /test | |
parent | a528908271c678360d2d8ca232c178e7cdd340b4 (diff) |
merge revision(s) fc03ba50f1ff6c30f7c654f564b4dffbed0844ef: [Backport #19263]
MJIT: Fix JIT code for multiple values in a single case
[Bug #19263]
---
lib/ruby_vm/mjit/compiler.rb | 2 +-
test/ruby/test_mjit.rb | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_mjit.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_mjit.rb b/test/ruby/test_mjit.rb index 399bf20071..a97747eb88 100644 --- a/test/ruby/test_mjit.rb +++ b/test/ruby/test_mjit.rb @@ -518,6 +518,16 @@ class TestMJIT < Test::Unit::TestCase end; end + def test_compile_multiple_values_case + assert_compile_twice("#{<<~"begin;"}\n#{<<~"end;"}", result_inspect: '"world"', insns: %i[opt_case_dispatch]) + begin; + case 'hello' + when 'hello', 'world' + 'world' + end + end; + end + def test_compile_insn_opt_calc assert_compile_twice('4 + 2 - ((2 * 3 / 2) % 2)', result_inspect: '5', insns: %i[opt_plus opt_minus opt_mult opt_div opt_mod]) assert_compile_twice('4.0 + 2.0 - ((2.0 * 3.0 / 2.0) % 2.0)', result_inspect: '5.0', insns: %i[opt_plus opt_minus opt_mult opt_div opt_mod]) |