Adjust os/arch checks to enable msan tests on freebsd/amd64.
R=go1.20
For #53298
Change-Id: I3d0f5259db73d526d006a12de5ba6284528cf819
Reviewed-on: https://go-review.googlesource.com/c/go/+/411276
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
switch goos {
case "linux":
return goarch == "amd64" || goarch == "arm64"
switch goos {
case "linux":
return goarch == "amd64" || goarch == "arm64"
+ case "freebsd":
+ return goarch == "amd64"
+ // Overcommit is enabled by default on FreeBSD (vm.overcommit=0, see tuning(7)).
+ // Do not skip tests with stricter overcommit settings unless testing shows that FreeBSD has similar issues.
+ if goos == "linux" {
+ requireOvercommit(t)
+ }
config := configure("memory")
config.skipIfCSanitizerBroken(t)
config := configure("memory")
config.skipIfCSanitizerBroken(t)
if gohostos == "linux" && (goarch == "amd64" || goarch == "ppc64le") {
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", ".")
}
if gohostos == "linux" && (goarch == "amd64" || goarch == "ppc64le") {
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", ".")
}
- if goos == "linux" {
- // because syscall.SysProcAttr struct used in misc/cgo/testsanitizers is only built on linux.
+ if goos == "linux" || (goos == "freebsd" && goarch == "amd64") {
+ // because Pdeathsig of syscall.SysProcAttr struct used in misc/cgo/testsanitizers is only
+ // supported on Linux and FreeBSD.
t.registerHostTest("testsanitizers", "../misc/cgo/testsanitizers", "misc/cgo/testsanitizers", ".")
}
if t.hasBash() && goos != "android" && !t.iOS() && gohostos != "windows" {
t.registerHostTest("testsanitizers", "../misc/cgo/testsanitizers", "misc/cgo/testsanitizers", ".")
}
if t.hasBash() && goos != "android" && !t.iOS() && gohostos != "windows" {