diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_zjit.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 0353a48eec..348907c79b 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -2240,6 +2240,24 @@ class TestZJIT < Test::Unit::TestCase } end + def test_opt_case_dispatch + assert_compiles '[true, false]', %q{ + def test(x) + case x + when :foo + true + else + false + end + end + + results = [] + results << test(:foo) + results << test(1) + results + }, insns: [:opt_case_dispatch] + end + private # Assert that every method call in `test_script` can be compiled by ZJIT |
