Hello! The default "go build" compile options over-optimize the auxiliary executable, built in TestCrashDumpsAllThreads testcase (libgo/go/runtime/crash_unix_test.go). This over-optimization results in removal of the trivial summing loop and in the inlining of the main.loop function into main.$thunk0.
The testcase expects backtrace that shows several instances of main.loop in the backtrace dump. When main.loop gets inlined into thunk, its name is not dumped anymore. The solution is to pass "-O0" to gccgo, which inhibits unwanted inlining. Patch was bootstrapped and regression tested on x86_64-linux-gnu and alphev68-linux-gnu, where for the later target the patch fixed the mentioned failure. Uros.
Index: go/runtime/crash_unix_test.go =================================================================== --- go/runtime/crash_unix_test.go (revision 256858) +++ go/runtime/crash_unix_test.go (working copy) @@ -63,7 +63,7 @@ func TestCrashDumpsAllThreads(t *testing.T) { t.Fatalf("failed to create Go file: %v", err) } - cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", "a.exe") + cmd := exec.Command(testenv.GoToolPath(t), "build", "-gccgoflags", "-O0", "-o", "a.exe") cmd.Dir = dir out, err := testenv.CleanCmdEnv(cmd).CombinedOutput() if err != nil {