ruby/bootstraptest/test_gc.rb
Takashi Kokubun 78b27ce62a RJIT: Streamline RJIT enablement check
in bootstrap tests so that `make btest-bruby` skips the right tests.
2023-12-21 14:32:03 -08:00

34 lines
741 B
Ruby

assert_normal_exit %q{
a = []
ms = "a".."k"
("A".."Z").each do |mod|
mod = eval("module #{mod}; self; end")
ms.each do |meth|
iseq = RubyVM::InstructionSequence.compile("module #{mod}; def #{meth}; end; end")
GC.stress = true
iseq.eval
GC.stress = false
end
o = Object.new.extend(mod)
ms.each do |meth|
o.send(meth)
end
end
}, '[ruby-dev:39453]' unless rjit_enabled? # speed up RJIT CI
assert_normal_exit %q{
a = []
ms = "a".."k"
("A".."Z").each do |mod|
mod = eval("module #{mod}; self; end")
ms.each do |meth|
GC.stress = true
mod.module_eval {define_method(meth) {}}
GC.stress = false
end
o = Object.new.extend(mod)
ms.each do |meth|
o.send(meth)
end
end
}, '[ruby-dev:39453]'