Skip to content

Commit a0fd00f

Browse files
authored
Merge pull request ruby#135 from jhawthorn/fix_test
Fix and uncomment getlocal test
2 parents 9139b17 + 26ba325 commit a0fd00f

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

test/ruby/test_yjit.rb

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,19 @@ def test_compile_eq_string
5555
assert_compiles('-"foo" == -"bar"', insns: %i[opt_eq], result: false)
5656
end
5757

58-
# FIXME: currently not working
59-
#def test_getlocal_with_level
60-
# assert_compiles(<<~RUBY, insns: %i[getlocal opt_plus], result: [[7]], exits: {leave: 2})
61-
# def foo(foo, bar)
62-
# [1].map do |x|
63-
# [1].map do |y|
64-
# foo + bar
65-
# end
66-
# end
67-
# end
68-
#
69-
# foo(5, 2)
70-
# RUBY
71-
#end
58+
def test_getlocal_with_level
59+
assert_compiles(<<~RUBY, insns: %i[getlocal opt_plus], result: [[7]])
60+
def foo(foo, bar)
61+
[1].map do |x|
62+
[1].map do |y|
63+
foo + bar
64+
end
65+
end
66+
end
67+
68+
foo(5, 2)
69+
RUBY
70+
end
7271

7372
def test_string_then_nil
7473
assert_compiles(<<~RUBY, insns: %i[opt_nil_p], result: true)

0 commit comments

Comments
 (0)