summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-02-19 15:03:12 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:30 -0400
commit48b8c5106ccdd4deb22035b9989e9feb86e199f7 (patch)
tree262898cd42cf21ef3541a1589c4db2aa106480bf /bootstraptest
parent064e3450536ad4c4fe49cb282d13713775d4ba8a (diff)
Mark and update object references in generated code
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_ujit.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/bootstraptest/test_ujit.rb b/bootstraptest/test_ujit.rb
index f28d1f37df..5d6695b34a 100644
--- a/bootstraptest/test_ujit.rb
+++ b/bootstraptest/test_ujit.rb
@@ -214,3 +214,21 @@ assert_equal ":special\n", %q{
p foo(special)
nil
}
+
+# Test that object references in generated code get marked and moved
+assert_equal "good", %q{
+ def bar
+ "good"
+ end
+
+ def foo
+ bar
+ end
+
+ foo
+ foo
+
+ GC.verify_compaction_references(double_heap: true, toward: :empty)
+
+ foo
+}