summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_jit.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 64ed277a75..4699de7d2a 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -19,10 +19,6 @@ class TestJIT < Test::Unit::TestCase
:answer,
# TODO: write tests for them
- :getlocal,
- :setlocal,
- :getlocal_WC_1,
- :setlocal_WC_1,
:reput,
:tracecoverage,
]
@@ -57,6 +53,23 @@ class TestJIT < Test::Unit::TestCase
foo = 1
foo
end;
+
+ insns = %i[setlocal getlocal setlocal_WC_0 getlocal_WC_0 setlocal_WC_1 getlocal_WC_1]
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", success_count: 3, stdout: '168', insns: insns)
+ begin;
+ def foo
+ a = 0
+ [1, 2].each do |i|
+ a += i
+ [3, 4].each do |j|
+ a *= j
+ end
+ end
+ a
+ end
+
+ print foo
+ end;
end
def test_compile_insn_blockparam