RJIT: Streamline RJIT enablement check

in bootstrap tests so that `make btest-bruby` skips the right tests.
This commit is contained in:
Takashi Kokubun 2023-12-21 14:30:55 -08:00
Родитель c73959cff4
Коммит 78b27ce62a
4 изменённых файлов: 16 добавлений и 12 удалений

Просмотреть файл

@ -789,4 +789,9 @@ def check_coredump
end
end
def rjit_enabled?
# Don't check `RubyVM::RJIT.enabled?`. On btest-bruby, target Ruby != runner Ruby.
ENV.fetch('RUN_OPTS', '').include?('rjit')
end
exit main

Просмотреть файл

@ -14,7 +14,7 @@ ms = "a".."k"
o.send(meth)
end
end
}, '[ruby-dev:39453]' unless ENV.fetch('RUN_OPTS', '').include?('rjit') # speed up RJIT CI
}, '[ruby-dev:39453]' unless rjit_enabled? # speed up RJIT CI
assert_normal_exit %q{
a = []

Просмотреть файл

@ -293,7 +293,6 @@ assert_normal_exit %q{
exec "/"
}
rjit_enabled = RUBY_DESCRIPTION.include?('+RJIT')
assert_normal_exit %q{
(0..10).map {
Thread.new {
@ -304,7 +303,7 @@ assert_normal_exit %q{
}.each {|t|
t.join
}
} unless rjit_enabled # flaky
} unless rjit_enabled? # flaky
assert_equal 'ok', %q{
def m
@ -498,7 +497,7 @@ assert_equal 'foo', %q{
[th1, th2].each {|t| t.join }
GC.start
f.call.source
} unless rjit_enabled # flaky
} unless rjit_enabled? # flaky
assert_normal_exit %q{
class C
def inspect

Просмотреть файл

@ -22,7 +22,7 @@ assert_equal '[:ae, :ae]', %q{
end
[test(Array.new 5), test([])]
} unless defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # Not yet working on RJIT
} unless rjit_enabled? # Not yet working on RJIT
# regression test for arity check with splat and send
assert_equal '[:ae, :ae]', %q{
@ -81,7 +81,7 @@ assert_equal 'ok', %q{
GC.compact
end
:ok
} unless defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # Not yet working on RJIT
} unless rjit_enabled? # Not yet working on RJIT
# regression test for overly generous guard elision
assert_equal '[0, :sum, 0, :sum]', %q{
@ -209,7 +209,7 @@ assert_equal '[:ok]', %q{
# Used to crash due to GC run in rb_ensure_iv_list_size()
# not marking the newly allocated [:ok].
RegressionTest.new.extender.itself
} unless RUBY_DESCRIPTION.include?('+RJIT') # Skip on RJIT since this uncovers a crash
} unless rjit_enabled? # Skip on RJIT since this uncovers a crash
assert_equal 'true', %q{
# regression test for tracking type of locals for too long
@ -1960,7 +1960,7 @@ assert_equal '[97, :nil, 97, :nil, :raised]', %q{
getbyte("a", 0)
[getbyte("a", 0), getbyte("a", 1), getbyte("a", -1), getbyte("a", -2), getbyte("a", "a")]
} unless defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # Not yet working on RJIT
} unless rjit_enabled? # Not yet working on RJIT
# Test << operator on string subclass
assert_equal 'abab', %q{
@ -2604,7 +2604,7 @@ assert_equal '[[:c_return, :String, :string_alias, "events_to_str"]]', %q{
events.compiled(events)
events
} unless defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # RJIT calls extra Ruby methods
} unless rjit_enabled? # RJIT calls extra Ruby methods
# test enabling a TracePoint that targets a particular line in a C method call
assert_equal '[true]', %q{
@ -2686,7 +2686,7 @@ assert_equal '[[:c_call, :itself]]', %q{
tp.enable { shouldnt_compile }
events
} unless defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # RJIT calls extra Ruby methods
} unless rjit_enabled? # RJIT calls extra Ruby methods
# test enabling c_return tracing before compiling
assert_equal '[[:c_return, :itself, main]]', %q{
@ -2701,7 +2701,7 @@ assert_equal '[[:c_return, :itself, main]]', %q{
tp.enable { shouldnt_compile }
events
} unless defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # RJIT calls extra Ruby methods
} unless rjit_enabled? # RJIT calls extra Ruby methods
# test c_call invalidation
assert_equal '[[:c_call, :itself]]', %q{
@ -4223,7 +4223,7 @@ assert_equal 'true', %q{
rescue ArgumentError
true
end
} unless defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # Not yet working on RJIT
} unless rjit_enabled? # Not yet working on RJIT
# Regresssion test: register allocator on expandarray
assert_equal '[]', %q{