Fieldtrack_enabled int
Preemptibleloops_enabled int
Clobberdead_enabled int
- DebugCPU_enabled int
)
// Toolchain experiments.
{"framepointer", &framepointer_enabled},
{"preemptibleloops", &Preemptibleloops_enabled},
{"clobberdead", &Clobberdead_enabled},
- {"debugcpu", &DebugCPU_enabled},
}
var defaultExpstring = Expstring()
// used by the Go standard library.
package cpu
-// DebugOptions is set to true by the runtime if go was compiled with GOEXPERIMENT=debugcpu
-// and GOOS is Linux or Darwin.
+// DebugOptions is set to true by the runtime if the OS supports GODEBUGCPU.
// This should not be changed after it is initialized.
var DebugOptions bool
// Initialize examines the processor and sets the relevant variables above.
// This is called by the runtime package early in program initialization,
-// before normal init functions are run. env is set by runtime on Linux and Darwin
-// if go was compiled with GOEXPERIMENT=debugcpu.
+// before normal init functions are run. env is set by runtime if the OS supports GODEBUGCPU.
func Initialize(env string) {
doinit()
processOptions(env)
"testing"
)
-func MustHaveDebugOptionsEnabled(t *testing.T) {
+func MustHaveDebugOptionsSupport(t *testing.T) {
if !DebugOptions {
- t.Skipf("skipping test: cpu feature options not enabled")
+ t.Skipf("skipping test: cpu feature options not supported by OS")
}
}
func runDebugOptionsTest(t *testing.T, test string, options string) {
- MustHaveDebugOptionsEnabled(t)
+ MustHaveDebugOptionsSupport(t)
testenv.MustHaveExec(t)
}
func TestAllCapabilitiesDisabled(t *testing.T) {
- MustHaveDebugOptionsEnabled(t)
+ MustHaveDebugOptionsSupport(t)
if os.Getenv("GODEBUGCPU") != "all=0" {
t.Skipf("skipping test: GODEBUGCPU=all=0 not set")
}
func TestSSE2DebugOption(t *testing.T) {
- MustHaveDebugOptionsEnabled(t)
+ MustHaveDebugOptionsSupport(t)
if os.Getenv("GODEBUGCPU") != "sse2=0" {
t.Skipf("skipping test: GODEBUGCPU=sse2=0 not set")
)
// cpuinit extracts the environment variable GODEBUGCPU from the environment on
-// Linux and Darwin if the GOEXPERIMENT debugcpu was set and calls internal/cpu.Initialize.
+// Linux and Darwin and calls internal/cpu.Initialize.
func cpuinit() {
const prefix = "GODEBUGCPU="
var env string
- if haveexperiment("debugcpu") && (GOOS == "linux" || GOOS == "darwin") {
+ if GOOS == "linux" || GOOS == "darwin" {
cpu.DebugOptions = true
// Similar to goenv_unix but extracts the environment value for