summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2024-06-13 20:39:11 +0100
committerAlan Wu <XrXr@users.noreply.github.com>2024-06-13 18:58:49 -0400
commit4ab7cc18184db53d6640d07a8bec573144c51875 (patch)
tree3ab830b269c0fadd480ce9f3fee217c10565a509
parentc093fd86d28318f2fb3541d339cf6d3aae1da7e2 (diff)
Guard against GC.compact when using in tests
This test will error on platforms that don't implement GC.compact Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
-rw-r--r--bootstraptest/test_yjit.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 9f35269fc5..015d04b8b0 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -123,6 +123,7 @@ assert_equal '[:ae, :ae]', %q{
# regression test for GC marking stubs in invalidated code
assert_normal_exit %q{
+ skip true unless defined?(GC.compact)
garbage = Array.new(10_000) { [] } # create garbage to cause iseq movement
eval(<<~RUBY)
def foo(n, garbage)
@@ -1229,6 +1230,7 @@ assert_equal 'special', %q{
# Test that object references in generated code get marked and moved
assert_equal "good", %q{
+ skip :good unless defined?(GC.compact)
def bar
"good"
end
@@ -2321,6 +2323,7 @@ assert_equal '123', %q{
# Test EP == BP invalidation with moving ISEQs
assert_equal 'ok', %q{
+ skip :ok unless defined?(GC.compact)
def entry
ok = proc { :ok } # set #entry as an EP-escaping ISEQ
[nil].reverse_each do # avoid exiting the JIT frame on the constant