1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_jit.rb: test local variables

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-05-02 16:27:33 +00:00
parent db8e95587e
commit d54e22860c

View file

@ -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