Description: Disable tests that don't work when using gccgo-7
 Initially created by Martín for gccgo-6 in Stretch.
 Updated by Anthony for gccgo-7 (7.1.0) and latest x/tools snapshot.
Author: Martín Ferrari <tincho@debian.org>
Author: Anthony Fok <foka@debian.org>
Origin: vendor
Forwarded: no
Last-Update: 2017-07-07
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/cmd/godoc/godoc_test.go
+++ b/cmd/godoc/godoc_test.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_test
 
 import (
--- a/cmd/gorename/gorename_test.go
+++ b/cmd/gorename/gorename_test.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_test
 
 import (
--- a/cmd/guru/guru_test.go
+++ b/cmd/guru/guru_test.go
@@ -234,6 +234,9 @@
 	case "windows":
 		t.Skipf("skipping test on %q (no /usr/bin/diff)", runtime.GOOS)
 	}
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
 
 	for _, filename := range []string{
 		"testdata/src/alias/alias.go", // iff guru.HasAlias (go1.9)
--- a/cmd/stringer/endtoend_test.go
+++ b/cmd/stringer/endtoend_test.go
@@ -5,6 +5,7 @@
 // go command is not available on android
 
 // +build !android
+// +build !gccgo
 
 package main
 
--- a/go/buildutil/util_test.go
+++ b/go/buildutil/util_test.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 buildutil_test
 
 import (
--- a/go/gcexportdata/example_test.go
+++ b/go/gcexportdata/example_test.go
@@ -4,6 +4,7 @@
 
 // +build go1.7
 // +build gc
+// +build !gccgo
 
 package gcexportdata_test
 
--- a/go/loader/example_test.go
+++ b/go/loader/example_test.go
@@ -4,6 +4,7 @@
 
 // +build go1.8,!go1.9 // TODO(adonovan) determine which versions we need to test here
 // +build !windows
+// +build !gccgo
 
 package loader_test
 
--- a/go/loader/loader_test.go
+++ b/go/loader/loader_test.go
@@ -110,6 +110,10 @@
 }
 
 func TestLoad_MissingInitialPackage(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+
 	var conf loader.Config
 	conf.Import("nosuchpkg")
 	conf.Import("errors")
@@ -813,8 +817,18 @@
 // Load package "io" twice in parallel.
 // When run with -race, this is a regression test for Go issue 20718, in
 // which the global "unsafe" package was modified concurrently.
-func TestLoad1(t *testing.T) { loadIO(t) }
-func TestLoad2(t *testing.T) { loadIO(t) }
+func TestLoad1(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+	loadIO(t)
+}
+func TestLoad2(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+	loadIO(t)
+}
 
 func loadIO(t *testing.T) {
 	t.Parallel()
--- a/go/loader/stdlib_test.go
+++ b/go/loader/stdlib_test.go
@@ -30,6 +30,9 @@
 	if runtime.GOOS == "android" {
 		t.Skipf("incomplete std lib on %s", runtime.GOOS)
 	}
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
 	if testing.Short() {
 		t.Skip("skipping in short mode; uses tons of memory (https://golang.org/issue/14113)")
 	}
@@ -128,6 +131,9 @@
 	case "android", "plan9", "solaris", "windows":
 		t.Skipf("no cgo or incomplete std lib on %s", runtime.GOOS)
 	}
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
 	// In nocgo builds (e.g. linux-amd64-nocgo),
 	// there is no "runtime/cgo" package,
 	// so cgo-generated Go files will have a failing import.
--- a/go/pointer/example_test.go
+++ b/go/pointer/example_test.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 pointer_test
 
 import (
--- a/go/pointer/pointer_test.go
+++ b/go/pointer/pointer_test.go
@@ -5,6 +5,7 @@
 // No testdata on Android.
 
 // +build !android
+// +build !gccgo
 
 package pointer_test
 
--- a/go/ssa/builder_test.go
+++ b/go/ssa/builder_test.go
@@ -13,6 +13,7 @@
 	"go/types"
 	"os"
 	"reflect"
+	"runtime"
 	"sort"
 	"strings"
 	"testing"
@@ -27,6 +28,10 @@
 // Tests that programs partially loaded from gc object files contain
 // functions with no code for the external portions, but are otherwise ok.
 func TestBuildPackage(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+
 	input := `
 package main
 
@@ -158,6 +163,10 @@
 
 // TestRuntimeTypes tests that (*Program).RuntimeTypes() includes all necessary types.
 func TestRuntimeTypes(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+
 	tests := []struct {
 		input string
 		want  []string
@@ -255,6 +264,10 @@
 // and to simplify the analysis whereby it deduces which stores to globals
 // can be lowered to global initializers.
 func TestInit(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+
 	tests := []struct {
 		mode        ssa.BuilderMode
 		input, want string
--- a/go/ssa/example_test.go
+++ b/go/ssa/example_test.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 ssa_test
 
 import (
--- a/go/ssa/interp/interp_test.go
+++ b/go/ssa/interp/interp_test.go
@@ -3,6 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // +build linux darwin
+// +build !gccgo
 
 package interp_test
 
--- a/go/ssa/source_test.go
+++ b/go/ssa/source_test.go
@@ -30,6 +30,9 @@
 	if runtime.GOOS == "android" {
 		t.Skipf("no testdata directory on %s", runtime.GOOS)
 	}
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
 
 	conf := loader.Config{ParserMode: parser.ParseComments}
 	src, err := ioutil.ReadFile("testdata/objlookup.go")
--- a/go/ssa/ssautil/load_test.go
+++ b/go/ssa/ssautil/load_test.go
@@ -12,6 +12,7 @@
 	"go/token"
 	"go/types"
 	"os"
+	"runtime"
 	"strings"
 	"testing"
 
@@ -32,6 +33,10 @@
 	// There is a more substantial test of BuildPackage and the
 	// SSA program it builds in ../ssa/builder_test.go.
 
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+
 	fset := token.NewFileSet()
 	f, err := parser.ParseFile(fset, "hello.go", hello, 0)
 	if err != nil {
--- a/go/ssa/stdlib_test.go
+++ b/go/ssa/stdlib_test.go
@@ -5,6 +5,7 @@
 // Incomplete source tree on Android.
 
 // +build !android
+// +build !gccgo
 
 package ssa_test
 
--- a/go/ssa/testmain_test.go
+++ b/go/ssa/testmain_test.go
@@ -9,6 +9,7 @@
 
 import (
 	"fmt"
+	"runtime"
 	"sort"
 	"testing"
 
@@ -36,6 +37,10 @@
 }
 
 func TestFindTests(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+
 	test := `
 package foo
 
--- a/refactor/eg/eg_test.go
+++ b/refactor/eg/eg_test.go
@@ -5,6 +5,7 @@
 // No testdata on Android.
 
 // +build !android
+// +build !gccgo
 
 package eg_test
 
--- a/refactor/importgraph/graph_test.go
+++ b/refactor/importgraph/graph_test.go
@@ -5,6 +5,7 @@
 // Incomplete std lib sources on Android.
 
 // +build !android
+// +build !gccgo
 
 package importgraph_test
 
--- a/refactor/rename/rename_test.go
+++ b/refactor/rename/rename_test.go
@@ -1283,6 +1283,9 @@
 	if runtime.GOOS == "plan9" {
 		t.Skipf("plan9 diff tool doesn't support -u flag")
 	}
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
 
 	defer func() {
 		Diff = false
--- a/cmd/gorename/cgo_test.go
+++ b/cmd/gorename/cgo_test.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
+// +build cgo,!gccgo
 
 package main_test
 
--- a/container/intsets/sparse_test.go
+++ b/container/intsets/sparse_test.go
@@ -8,6 +8,7 @@
 	"fmt"
 	"log"
 	"math/rand"
+	"runtime"
 	"sort"
 	"strings"
 	"testing"
@@ -576,6 +577,10 @@
 }
 
 func TestFailFastOnShallowCopy(t *testing.T) {
+	if runtime.Compiler == "gccgo" {
+		t.Skip("Test disabled on gccgo.")
+	}
+
 	var x intsets.Sparse
 	x.Insert(1)
 
