if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("gccgo does not have SetCgoTraceback")
+ }
got := runTestProg(t, "testprogcgo", "CrashTraceback")
for i := 1; i <= 3; i++ {
if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) {
func TestCgoTracebackContext(t *testing.T) {
t.Parallel()
+ if runtime.Compiler == "gccgo" {
+ t.Skip("gccgo does not have SetCgoTraceback")
+ }
got := runTestProg(t, "testprogcgo", "TracebackContext")
want := "OK\n"
if got != want {
if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("gccgo does not have SetCgoTraceback")
+ }
testenv.MustHaveGoRun(t)
exe, err := buildTestProg(t, "testprogcgo", buildArg)
if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
+ if runtime.Compiler == "gccgo" {
+ t.Skip("gccgo does not have SetCgoTraceback")
+ }
testenv.MustHaveGoRun(t)
}
func TestStackOverflow(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("gccgo does not do stack overflow checking")
+ }
output := runTestProg(t, "testprog", "StackOverflow")
want := "runtime: goroutine stack exceeds 1474560-byte limit\nfatal error: stack overflow"
if !strings.HasPrefix(output, want) {
func TestBreakpoint(t *testing.T) {
output := runTestProg(t, "testprog", "Breakpoint")
- want := "runtime.Breakpoint()"
+ want := "runtime.Breakpoint"
if !strings.Contains(output, want) {
t.Fatalf("output:\n%s\n\nwant output containing: %s", output, want)
}
// Check functions in the traceback.
fns := []string{"main.pt1.func1", "panic", "main.pt2.func1", "panic", "main.pt2", "main.pt1"}
+ if runtime.Compiler == "gccgo" {
+ fns = []string{"main.$nested", "panic", "main.$nested", "panic", "main.pt2", "main.pt1"}
+ }
for _, fn := range fns {
- re := regexp.MustCompile(`(?m)^` + regexp.QuoteMeta(fn) + `\(.*\n`)
+ var re *regexp.Regexp
+ if runtime.Compiler != "gccgo" {
+ re = regexp.MustCompile(`(?m)^` + regexp.QuoteMeta(fn) + `\(.*\n`)
+ } else {
+ re = regexp.MustCompile(`(?m)^` + regexp.QuoteMeta(fn) + `.*\n`)
+ }
idx := re.FindStringIndex(output)
if idx == nil {
t.Fatalf("expected %q function in traceback:\n%s", fn, output)
func TestMemPprof(t *testing.T) {
testenv.MustHaveGoRun(t)
+ if runtime.Compiler == "gccgo" {
+ t.Skip("gccgo may not have the pprof tool")
+ }
exe, err := buildTestProg(t, "testprog")
if err != nil {