diff options
Diffstat (limited to 'test/lib/jit_support.rb')
-rw-r--r-- | test/lib/jit_support.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lib/jit_support.rb b/test/lib/jit_support.rb index 3f21367987..cf3baaaeb7 100644 --- a/test/lib/jit_support.rb +++ b/test/lib/jit_support.rb @@ -9,6 +9,10 @@ module JITSupport @yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT']) end + def yjit_enabled? + defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled? + end + def yjit_force_enabled? "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/) end @@ -19,6 +23,10 @@ module JITSupport @rjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['RJIT_SUPPORT']) end + def rjit_enabled? + defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? + end + def rjit_force_enabled? "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?RJIT_FORCE_ENABLE\b/) end |