Revert an accidentally sync.

Revert "[ruby/open3] Removed to load jit_support.rb"

  This reverts commit 67feb782f947046f65951303893713052a19a546.
This commit is contained in:
Hiroshi SHIBATA 2023-03-27 12:28:11 +09:00
parent 67feb782f9
commit cc8a48a496
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

25
test/lib/jit_support.rb Normal file
View File

@ -0,0 +1,25 @@
require 'rbconfig'
module JITSupport
module_function
def yjit_supported?
return @yjit_supported if defined?(@yjit_supported)
# nil in mswin
@yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT'])
end
def yjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/)
end
def rjit_supported?
return @rjit_supported if defined?(@rjit_supported)
# nil in mswin
@rjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['RJIT_SUPPORT'])
end
def rjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?RJIT_FORCE_ENABLE\b/)
end
end