if testing.Short() && runtime.GOOS == "windows" {
t.Skip("Skipping in short mode") // takes up to 64 seconds
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoSignalDeadlock")
want := "OK\n"
if got != want {
}
func TestCgoTraceback(t *testing.T) {
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
+
t.Parallel()
got := runTestProg(t, "testprogcgo", "CgoTraceback")
want := "OK\n"
case "plan9", "windows":
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
if testing.Short() {
switch {
case runtime.GOOS == "dragonfly":
case "plan9", "windows":
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
if testenv.CPUProfilingBroken() {
t.Skip("skipping on platform with broken profiling")
}
if runtime.GOOS == "plan9" {
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoExternalThreadPanic")
want := "panic: BOOM"
if !strings.Contains(got, want) {
case "plan9", "windows":
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoExternalThreadSIGPROF", "GO_START_SIGPROF_THREAD=1")
if want := "OK\n"; got != want {
case "plan9", "windows":
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoExternalThreadSignal")
if want := "OK\n"; got != want {
if runtime.GOOS != "windows" {
t.Skip("skipping windows specific test")
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoDLLImportsMain")
want := "OK\n"
if got != want {
case "windows", "plan9":
t.Skipf("skipping signal mask test on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoExecSignalMask", "GOTRACEBACK=system")
want := "OK\n"
if got != want {
case "windows", "plan9":
t.Skipf("skipping dropm test on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "EnsureDropM")
want := "OK\n"
if got != want {
t.Parallel()
// Make sure we don't count the build time as part of the run time.
testenv.MustHaveGoBuild(t)
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
exe, err := buildTestProg(t, "testprogcgo")
if err != nil {
t.Fatal(err)
func TestCgoPanicDeadlock(t *testing.T) {
t.Parallel()
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
// test issue 14432
got := runTestProg(t, "testprogcgo", "CgoPanicDeadlock")
want := "panic: cgo error\n\n"
func TestCgoCCodeSIGPROF(t *testing.T) {
t.Parallel()
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoCCodeSIGPROF")
want := "OK\n"
if got != want {
case "windows", "plan9":
t.Skipf("skipping cgo pprof callback test on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoPprofCallback")
want := "OK\n"
if got != want {
if asan.Enabled || msan.Enabled {
t.Skip("skipping test on ASAN/MSAN: triggers SIGSEGV in sanitizer runtime")
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CrashTraceback")
for i := 1; i <= 3; i++ {
if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) {
default:
t.Skipf("not yet supported on %s", platform)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CrashTracebackGo")
for i := 1; i <= 3; i++ {
want := fmt.Sprintf("main.h%d", i)
func TestCgoTracebackContext(t *testing.T) {
t.Parallel()
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "TracebackContext")
want := "OK\n"
if got != want {
func TestCgoTracebackContextPreemption(t *testing.T) {
t.Parallel()
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "TracebackContextPreemption")
want := "OK\n"
if got != want {
func TestCgoTracebackContextProfile(t *testing.T) {
t.Parallel()
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "TracebackContextProfile")
want := "OK\n"
if got != want {
if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le" && runtime.GOARCH != "arm64" && runtime.GOARCH != "loong64") {
t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
testenv.MustHaveGoRun(t)
var args []string
t.Skipf("skipping: test requires pthread support")
// TODO: Can this test be rewritten to use the C11 thread API instead?
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
testenv.MustHaveGoRun(t)
if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
testenv.SkipFlaky(t, 60316)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
case "windows", "plan9":
t.Skipf("skipping numgoroutine test on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
got := runTestProg(t, "testprogcgo", "NumGoroutine")
want := "OK\n"
t.Skipf("crash() on darwin/amd64 doesn't raise SIGABRT")
}
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
testenv.MustHaveGoRun(t)
case "plan9", "windows":
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
testLockOSThreadExit(t, "testprogcgo")
}
case "plan9", "windows":
t.Skipf("no sigaltstack on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
got := runTestProg(t, "testprogcgo", "SigStack")
want := "OK\n"
if asan.Enabled || msan.Enabled {
t.Skip("skipping test on ASAN/MSAN: triggers SIGSEGV in sanitizer runtime")
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
if runtime.GOOS == "ios" {
testenv.SkipFlaky(t, 59912)
}
}
func TestCgoPanicCallback(t *testing.T) {
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
got := runTestProg(t, "testprogcgo", "PanicCallback")
t.Log(got)
if test == "SegvInCgo" && runtime.GOOS == "ios" {
testenv.SkipFlaky(t, 59947) // Don't even try, in case it times out.
}
+ if strings.HasSuffix(test, "InCgo") && runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
prog := "testprog"
// without going through the runtime at all.
t.Skipf("no signals on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
got := runTestProg(t, "testprogcgo", "Abort")
t.Skip("skipping on linux-386; C sigaction does not preserve Go restorer")
}
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
output := runTestProg(t, "testprogcgo", "EINTR")
case "plan9", "windows":
t.Skipf("no signals on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
output := runTestProg(t, "testprogcgo", "NeedmDeadlock")
want := "OK\n"
if output != want {
}
func TestCgoNoCallback(t *testing.T) {
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoNoCallback")
want := "function marked with #cgo nocallback called back into Go"
if !strings.Contains(got, want) {
if asan.Enabled {
t.Skip("skipping test: ASAN forces extra heap allocations")
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoNoEscape")
want := "OK\n"
if got != want {
// Issue #63739.
func TestCgoEscapeWithMultiplePointers(t *testing.T) {
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoEscapeWithMultiplePointers")
want := "OK\n"
if got != want {
}
func TestCgoTracebackGoroutineProfile(t *testing.T) {
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
output := runTestProg(t, "testprogcgo", "GoroutineProfile")
want := "OK\n"
if output != want {
if !goos.IsUnix {
t.Skipf("no signals on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "CgoSigfwd", "GO_TEST_CGOSIGFWD=1")
if want := "OK\n"; got != want {
}
func TestDestructorCallback(t *testing.T) {
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
t.Parallel()
got := runTestProg(t, "testprogcgo", "DestructorCallback")
if want := "OK\n"; got != want {
case "windows", "plan9":
t.Skipf("skipping bindm test on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "EnsureBindM")
want := "OK\n"
if got != want {
// ASAN prints this as a warning.
t.Skip("skipping test on ASAN because ASAN doesn't fully support makecontext/swapcontext functions")
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
got := runTestProg(t, "testprogcgo", "StackSwitchCallback")
skip := "SKIP\n"
if got == skip {
if runtime.GOOS == "plan9" || runtime.GOOS == "windows" {
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if runtime.GOOS == "freebsd" && race.Enabled {
+ t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+ }
output := runTestProg(t, "testprogcgo", "CgoToGoCallGoexit")
if !strings.Contains(output, "runtime.Goexit called in a thread that was not created by the Go runtime") {
t.Fatalf("output should contain %s, got %s", "runtime.Goexit called in a thread that was not created by the Go runtime", output)