From 2a208bc2570b07b64deb1d549332e5d981c867bc Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 22 Jun 2017 14:27:09 +0000 Subject: runtime: don't build test files that use SetCgoTraceback for gccgo The gofrontend doesn't support the runtime.SetCgoTraceback function, which is specifically for handling mixed Go and C tracebacks. Use a build tag to avoid compiling the runtime/testdata/testprogcgo files that refer to SetCgoTraceback. These files are not currently compiled anyhow, but they will be with a future gotools patch. Reviewed-on: https://go-review.googlesource.com/46452 From-SVN: r249556 --- libgo/go/runtime/testdata/testprogcgo/pprof.go | 2 ++ libgo/go/runtime/testdata/testprogcgo/raceprof.go | 1 + libgo/go/runtime/testdata/testprogcgo/threadpprof.go | 1 + libgo/go/runtime/testdata/testprogcgo/traceback.go | 2 ++ libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go | 2 ++ libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c | 2 ++ 6 files changed, 10 insertions(+) (limited to 'libgo/go') diff --git a/libgo/go/runtime/testdata/testprogcgo/pprof.go b/libgo/go/runtime/testdata/testprogcgo/pprof.go index 4460b93..c4fde02 100644 --- a/libgo/go/runtime/testdata/testprogcgo/pprof.go +++ b/libgo/go/runtime/testdata/testprogcgo/pprof.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !gccgo + package main // Run a slow C function saving a CPU profile. diff --git a/libgo/go/runtime/testdata/testprogcgo/raceprof.go b/libgo/go/runtime/testdata/testprogcgo/raceprof.go index fe624c5..466a367 100644 --- a/libgo/go/runtime/testdata/testprogcgo/raceprof.go +++ b/libgo/go/runtime/testdata/testprogcgo/raceprof.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // +build linux,amd64 +// +build !gccgo package main diff --git a/libgo/go/runtime/testdata/testprogcgo/threadpprof.go b/libgo/go/runtime/testdata/testprogcgo/threadpprof.go index 3da8296..bec4ef5 100644 --- a/libgo/go/runtime/testdata/testprogcgo/threadpprof.go +++ b/libgo/go/runtime/testdata/testprogcgo/threadpprof.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // +build !plan9,!windows +// +build !gccgo package main diff --git a/libgo/go/runtime/testdata/testprogcgo/traceback.go b/libgo/go/runtime/testdata/testprogcgo/traceback.go index 2a023f6..d21990e 100644 --- a/libgo/go/runtime/testdata/testprogcgo/traceback.go +++ b/libgo/go/runtime/testdata/testprogcgo/traceback.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !gccgo + package main // This program will crash. diff --git a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go index 51fa4ad..3940a77 100644 --- a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go +++ b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go @@ -4,6 +4,8 @@ // The __attribute__((weak)) used below doesn't seem to work on Windows. +// +build !gccgo + package main // Test the context argument to SetCgoTraceback. diff --git a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c index 900cada..f02b7ca 100644 --- a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c +++ b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c @@ -5,6 +5,8 @@ // The C definitions for tracebackctxt.go. That file uses //export so // it can't put function definitions in the "C" import comment. +// +build !gccgo + #include #include -- cgit v1.1