test: recognize and use gc build tag

Change the run.go driver to recognize the "gc" build tag.

Change existing tests to use the "gc" build tag if they use some
feature that seems specific to the gc compiler, such as passing specific
options to or expecting specific behavior from "go tool compile".
Change tests to use the "!gccgo" build tag if they use "go build" or
"go run", as while those might work with compilers other than gc, they
won't work with the way that gccgo runs its testsuite (which happens
independently of the go command).

For #43252

Change-Id: I666e04b6d7255a77dfc256ee304094e3a6bb15ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/279052
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Ian Lance Taylor 2020-12-17 14:03:07 -08:00
parent 8fcf318123
commit f1778c28a9
22 changed files with 22 additions and 37 deletions

View file

@ -1,4 +1,4 @@
// +build !nacl,!js
// +build !nacl,!js,gc
// run
// Copyright 2015 The Go Authors. All rights reserved.