diff options
Diffstat (limited to 'test/ruby/test_yjit.rb')
-rw-r--r-- | test/ruby/test_yjit.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 6b6ea6619e..d390a19cbc 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -1058,6 +1058,22 @@ class TestYJIT < Test::Unit::TestCase RUBY end + def test_gc_compact_cyclic_branch + assert_compiles(<<~'RUBY', result: 2) + def foo + i = 0 + while i < 2 + i += 1 + end + i + end + + foo + GC.compact + foo + RUBY + end + private def code_gc_helpers |