]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/script: define GOOS, GOARCH, and compiler conditions using suffixes
authorBryan C. Mills <bcmills@google.com>
Thu, 28 Jul 2022 17:50:59 +0000 (13:50 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 24 Oct 2022 21:26:10 +0000 (21:26 +0000)
This replaces a large set of individual GOOS and GOARCH conditions
with a smaller set of more verbose conditions. On balance, the more
uniform structure and more concise documentation seem worth the
verbosity.

For #27494.

Change-Id: I73fdf9e7180a92cb1baf5d4631aeecb26ce15181
Reviewed-on: https://go-review.googlesource.com/c/go/+/420054
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>

90 files changed:
src/cmd/go/internal/script/conds.go
src/cmd/go/scriptconds_test.go
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/bug.txt
src/cmd/go/testdata/script/build_GOTMPDIR.txt
src/cmd/go/testdata/script/build_acl_windows.txt
src/cmd/go/testdata/script/build_cache_output.txt
src/cmd/go/testdata/script/build_cd_gopath_different.txt
src/cmd/go/testdata/script/build_cgo_consistent_results.txt
src/cmd/go/testdata/script/build_darwin_cc_arch.txt
src/cmd/go/testdata/script/build_gcflags.txt
src/cmd/go/testdata/script/build_internal.txt
src/cmd/go/testdata/script/build_issue48319.txt
src/cmd/go/testdata/script/build_issue6480.txt
src/cmd/go/testdata/script/build_link_x_import_path_escape.txt
src/cmd/go/testdata/script/build_nocache.txt
src/cmd/go/testdata/script/build_output.txt
src/cmd/go/testdata/script/build_tags_no_comma.txt
src/cmd/go/testdata/script/build_trimpath_cgo.txt
src/cmd/go/testdata/script/build_unsupported_goos.txt
src/cmd/go/testdata/script/cache_unix.txt
src/cmd/go/testdata/script/cache_vet.txt
src/cmd/go/testdata/script/cgo_bad_directives.txt
src/cmd/go/testdata/script/cgo_path.txt
src/cmd/go/testdata/script/cgo_path_space.txt
src/cmd/go/testdata/script/cgo_stale_precompiled.txt
src/cmd/go/testdata/script/cgo_syso_issue29253.txt
src/cmd/go/testdata/script/cover_asm.txt
src/cmd/go/testdata/script/cover_cgo.txt
src/cmd/go/testdata/script/cover_cgo_extra_file.txt
src/cmd/go/testdata/script/cover_cgo_extra_test.txt
src/cmd/go/testdata/script/cover_cgo_xtest.txt
src/cmd/go/testdata/script/cover_dash_c.txt
src/cmd/go/testdata/script/cover_dep_loop.txt
src/cmd/go/testdata/script/cover_dot_import.txt
src/cmd/go/testdata/script/cover_error.txt
src/cmd/go/testdata/script/cover_import_main_loop.txt
src/cmd/go/testdata/script/cover_modes.txt
src/cmd/go/testdata/script/cover_pattern.txt
src/cmd/go/testdata/script/cover_runs.txt
src/cmd/go/testdata/script/cover_sync_atomic_import.txt
src/cmd/go/testdata/script/embed_brackets.txt
src/cmd/go/testdata/script/env_write.txt
src/cmd/go/testdata/script/gcflags_patterns.txt
src/cmd/go/testdata/script/generate_bad_imports.txt
src/cmd/go/testdata/script/generate_env.txt
src/cmd/go/testdata/script/generate_goroot_PATH.txt
src/cmd/go/testdata/script/get_goroot.txt
src/cmd/go/testdata/script/gopath_local.txt
src/cmd/go/testdata/script/gopath_std_vendor.txt
src/cmd/go/testdata/script/goroot_executable.txt
src/cmd/go/testdata/script/install_cross_gobin.txt
src/cmd/go/testdata/script/link_syso_deps.txt
src/cmd/go/testdata/script/link_syso_issue33139.txt
src/cmd/go/testdata/script/linkname.txt
src/cmd/go/testdata/script/list_ambiguous_path.txt
src/cmd/go/testdata/script/list_gofile_in_goroot.txt
src/cmd/go/testdata/script/list_importmap.txt
src/cmd/go/testdata/script/list_perm.txt
src/cmd/go/testdata/script/list_replace_absolute_windows.txt
src/cmd/go/testdata/script/list_std.txt
src/cmd/go/testdata/script/list_swigcxx.txt
src/cmd/go/testdata/script/mod_cache_rw.txt
src/cmd/go/testdata/script/mod_doc_path.txt
src/cmd/go/testdata/script/mod_download_concurrent_read.txt
src/cmd/go/testdata/script/mod_download_issue51114.txt
src/cmd/go/testdata/script/mod_file_proxy.txt
src/cmd/go/testdata/script/mod_fileproxy_vcs_missing_issue51589.txt
src/cmd/go/testdata/script/mod_gomodcache.txt
src/cmd/go/testdata/script/mod_list_std.txt
src/cmd/go/testdata/script/mod_perm.txt
src/cmd/go/testdata/script/mod_permissions.txt
src/cmd/go/testdata/script/mod_std_vendor.txt
src/cmd/go/testdata/script/mod_sumdb_file_path.txt
src/cmd/go/testdata/script/mod_tidy_temp.txt
src/cmd/go/testdata/script/std_vendor.txt
src/cmd/go/testdata/script/test2json_interrupt.txt
src/cmd/go/testdata/script/test_fuzz_mutator_repeat.txt
src/cmd/go/testdata/script/test_fuzz_non_crash_signal.txt
src/cmd/go/testdata/script/test_goroot_PATH.txt
src/cmd/go/testdata/script/test_json.txt
src/cmd/go/testdata/script/test_ppc64_linker_funcs.txt
src/cmd/go/testdata/script/test_ppc64le_cgo_inline_plt.txt
src/cmd/go/testdata/script/test_profile.txt
src/cmd/go/testdata/script/toolexec.txt
src/cmd/go/testdata/script/vendor_gopath_issue11409.txt
src/cmd/go/testdata/script/version.txt
src/cmd/go/testdata/script/version_build_settings.txt
src/cmd/go/testdata/script/version_buildvcs_fossil.txt
src/cmd/go/testdata/script/vet_asm.txt

index 5d0deb5377b1b0fb952f48f65e9b56ca95382dab..d70f274efc2261a50ce96022bcf44a021b0b1a1d 100644 (file)
@@ -6,6 +6,7 @@ package script
 
 import (
        "cmd/go/internal/imports"
+       "fmt"
        "os"
        "runtime"
        "sync"
@@ -18,18 +19,43 @@ import (
 func DefaultConds() map[string]Cond {
        conds := make(map[string]Cond)
 
-       // TODO(bcmills): switch these conditions to use suffixes, like '[GOOS:windows]'
-       // instead of just '[windows]'.
-
-       for os := range imports.KnownOS {
-               conds[os] = BoolCondition("host GOOS="+os, false)
-       }
-       conds[runtime.GOOS] = BoolCondition("host GOOS="+runtime.GOOS, true)
-
-       for arch := range imports.KnownArch {
-               conds[arch] = BoolCondition("host GOARCH="+arch, false)
-       }
-       conds[runtime.GOARCH] = BoolCondition("host GOARCH="+runtime.GOARCH, true)
+       conds["GOOS"] = PrefixCondition(
+               "runtime.GOOS == <suffix>",
+               func(_ *State, suffix string) (bool, error) {
+                       if suffix == runtime.GOOS {
+                               return true, nil
+                       }
+                       if _, ok := imports.KnownOS[suffix]; !ok {
+                               return false, fmt.Errorf("unrecognized GOOS %q", suffix)
+                       }
+                       return false, nil
+               })
+
+       conds["GOARCH"] = PrefixCondition(
+               "runtime.GOARCH == <suffix>",
+               func(_ *State, suffix string) (bool, error) {
+                       if suffix == runtime.GOARCH {
+                               return true, nil
+                       }
+                       if _, ok := imports.KnownArch[suffix]; !ok {
+                               return false, fmt.Errorf("unrecognized GOOS %q", suffix)
+                       }
+                       return false, nil
+               })
+
+       conds["compiler"] = PrefixCondition(
+               "runtime.Compiler == <suffix>",
+               func(_ *State, suffix string) (bool, error) {
+                       if suffix == runtime.Compiler {
+                               return true, nil
+                       }
+                       switch suffix {
+                       case "gc", "gccgo":
+                               return false, nil
+                       default:
+                               return false, fmt.Errorf("unrecognized compiler %q", suffix)
+                       }
+               })
 
        conds["root"] = BoolCondition("os.Geteuid() == 0", os.Geteuid() == 0)
 
index 6e92cd104b7684d6ec6d56fb10c10f781189ce95..676de3b353ddd42f726fd47efb953e899bca828a 100644 (file)
@@ -41,8 +41,6 @@ func scriptConditions() map[string]script.Cond {
        add("cross", script.BoolCondition("cmd/go GOOS/GOARCH != GOHOSTOS/GOHOSTARCH", goHostOS != runtime.GOOS || goHostArch != runtime.GOARCH))
        add("fuzz", sysCondition("-fuzz", platform.FuzzSupported))
        add("fuzz-instrumented", sysCondition("-fuzz with instrumentation", platform.FuzzInstrumented))
-       add("gc", script.BoolCondition(`runtime.Compiler == "gc"`, runtime.Compiler == "gc"))
-       add("gccgo", script.BoolCondition(`runtime.Compiler == "gccgo"`, runtime.Compiler == "gccgo"))
        add("git", lazyBool("the 'git' executable exists and provides the standard CLI", hasWorkingGit))
        add("GODEBUG", script.PrefixCondition("GODEBUG contains <suffix>", hasGodebug))
        add("GOEXPERIMENT", script.PrefixCondition("GOEXPERIMENT <suffix> is enabled", hasGoexperiment))
index 8724d052e3493d503828de4f9c671c73b98bf164..b3902eded516996f743db6d9bea48a05e2c10a4f 100644 (file)
@@ -362,28 +362,14 @@ wait
 
 
 The available conditions are:
-[386]
-       host GOARCH=386
+[GOARCH:*]
+       runtime.GOARCH == <suffix>
 [GODEBUG:*]
        GODEBUG contains <suffix>
 [GOEXPERIMENT:*]
        GOEXPERIMENT <suffix> is enabled
-[aix]
-       host GOOS=aix
-[amd64]
-       host GOARCH=amd64
-[amd64p32]
-       host GOARCH=amd64p32
-[android]
-       host GOOS=android
-[arm]
-       host GOARCH=arm
-[arm64]
-       host GOARCH=arm64
-[arm64be]
-       host GOARCH=arm64be
-[armbe]
-       host GOARCH=armbe
+[GOOS:*]
+       runtime.GOOS == <suffix>
 [asan]
        GOOS/GOARCH supports -asan
 [buildmode:*]
@@ -392,102 +378,36 @@ The available conditions are:
        $WORK filesystem is case-sensitive
 [cgo]
        host CGO_ENABLED
+[compiler:*]
+       runtime.Compiler == <suffix>
 [cross]
        cmd/go GOOS/GOARCH != GOHOSTOS/GOHOSTARCH
-[darwin]
-       host GOOS=darwin
-[dragonfly]
-       host GOOS=dragonfly
 [exec:*]
        <suffix> names an executable in the test binary's PATH
-[freebsd]
-       host GOOS=freebsd
 [fuzz]
        GOOS/GOARCH supports -fuzz
 [fuzz-instrumented]
        GOOS/GOARCH supports -fuzz with instrumentation
-[gc]
-       runtime.Compiler == "gc"
-[gccgo]
-       runtime.Compiler == "gccgo"
 [git]
        the 'git' executable exists and provides the standard CLI
-[hurd]
-       host GOOS=hurd
-[illumos]
-       host GOOS=illumos
-[ios]
-       host GOOS=ios
-[js]
-       host GOOS=js
 [link]
        testenv.HasLink()
-[linux]
-       host GOOS=linux
-[loong64]
-       host GOARCH=loong64
-[mips]
-       host GOARCH=mips
-[mips64]
-       host GOARCH=mips64
-[mips64le]
-       host GOARCH=mips64le
-[mips64p32]
-       host GOARCH=mips64p32
-[mips64p32le]
-       host GOARCH=mips64p32le
-[mipsle]
-       host GOARCH=mipsle
 [mismatched-goroot]
        test's GOROOT_FINAL does not match the real GOROOT
 [msan]
        GOOS/GOARCH supports -msan
-[nacl]
-       host GOOS=nacl
 [net]
        testenv.HasExternalNetwork()
-[netbsd]
-       host GOOS=netbsd
-[openbsd]
-       host GOOS=openbsd
-[plan9]
-       host GOOS=plan9
-[ppc]
-       host GOARCH=ppc
-[ppc64]
-       host GOARCH=ppc64
-[ppc64le]
-       host GOARCH=ppc64le
 [race]
        GOOS/GOARCH supports -race
-[riscv]
-       host GOARCH=riscv
-[riscv64]
-       host GOARCH=riscv64
 [root]
        os.Geteuid() == 0
-[s390]
-       host GOARCH=s390
-[s390x]
-       host GOARCH=s390x
 [short]
        testing.Short()
-[solaris]
-       host GOOS=solaris
-[sparc]
-       host GOARCH=sparc
-[sparc64]
-       host GOARCH=sparc64
 [symlink]
        testenv.HasSymlink()
 [trimpath]
        test binary was built with -trimpath
 [verbose]
        testing.Verbose()
-[wasm]
-       host GOARCH=wasm
-[windows]
-       host GOOS=windows
-[zos]
-       host GOOS=zos
 
index 571d507358ade486cfdc46b59dbe07925fbcc6c9..f64fb85bdc42e037f6c8ec7b894b3baa728a78f6 100644 (file)
@@ -1,6 +1,6 @@
 # Verify that go bug creates the appropriate URL issue body
 
-[!linux] skip
+[!GOOS:linux] skip
 [short] skip
 
 go install
index 1073517c29891caf86c289af31ca6e8d2afe462f..4c9129ec45c5ddc58fd2fd7dd892a74ed72ae2c9 100644 (file)
@@ -1,10 +1,10 @@
 # Set GOCACHE to a clean directory to ensure that 'go build' has work to report.
-[!windows] env GOCACHE=$WORK/gocache
-[windows] env GOCACHE=$WORK\gocache
+[!GOOS:windows] env GOCACHE=$WORK/gocache
+[GOOS:windows] env GOCACHE=$WORK\gocache
 
 # 'go build' should use GOTMPDIR if set.
-[!windows] env GOTMPDIR=$WORK/my-favorite-tmpdir
-[windows] env GOTMPDIR=$WORK\my-favorite-tmpdir
+[!GOOS:windows] env GOTMPDIR=$WORK/my-favorite-tmpdir
+[GOOS:windows] env GOTMPDIR=$WORK\my-favorite-tmpdir
 mkdir $GOTMPDIR
 go build -x hello.go
 stderr ^WORK=.*my-favorite-tmpdir
index 13a3ba226aa851bdbaefc76f25b05fc2e4b38368..2cb60e0ffdcfdba14cfe820db7d29d271751796b 100644 (file)
@@ -1,4 +1,4 @@
-[!windows] stop
+[!GOOS:windows] stop
 [!exec:icacls] skip
 [!exec:powershell] skip
 
index 0d94bf61a9a3a772c27553de2cfa22bb16def539..fc040b48cfe5f0a6a7748d15a3de1fc1a8e1c009 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=off
 env GODEBUG=gocachetest=1
 
-[!gc] skip
+[!compiler:gc] skip
 [short] skip # clears cache, rebuilds too much
 
 # Set up fresh GOCACHE.
index a7a4bf412d0c11399ead394381707138111bce61..64d7d74ce214fd9b4567d19067885ea3e985924f 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip 'gccgo does not support -ldflags -X'
+[compiler:gccgo] skip 'gccgo does not support -ldflags -X'
 env GO111MODULE=off
 go build run_go.go
 
@@ -8,7 +8,7 @@ exec $WORK/tmp/a.exe
 stderr 'linkXworked'
 rm $WORK/tmp/a.exe
 
-[!windows] stop 'rest of the tests only apply to Windows'
+[!GOOS:windows] stop 'rest of the tests only apply to Windows'
 
 # Replace '\' with '/' in GOPATH
 exec ./run_go$GOEXE $GOPATH/src/my.pkg/main $GOPATH REPLACE_SLASH build -o $WORK/tmp/a.exe -ldflags -X=my.pkg.Text=linkXworked
index 88a24de81478408ea807b1f1846680dc06627602..f22994f71fcaf5247c483af3e274d29d640bc4f3 100644 (file)
@@ -1,8 +1,8 @@
 [short] skip
 [!cgo] skip
 
-[solaris] skip "skipping on Solaris; see golang.org/issue/13247"
-[illumos] skip "skipping on Solaris; see golang.org/issue/13247"
+[GOOS:solaris] skip "skipping on Solaris; see golang.org/issue/13247"
+[GOOS:illumos] skip "skipping on Solaris; see golang.org/issue/13247"
 
 go build -o $WORK/exe1$GOEXE cgotest
 go build -x -o $WORK/exe2$GOEXE cgotest
index 2b81b4cf80b6968a022dcbf526680690714b840d..df3fa5bd35fa90863d795f6aac73e52ee08511e2 100644 (file)
@@ -1,6 +1,6 @@
 # Test that we pass -arch flag to C compiler on Darwin (issue 43692).
 
-[!darwin] skip
+[!GOOS:darwin] skip
 [!cgo] skip
 
 # clear CC, in case user sets it
index b47237410d1956ff8357f0486935f21c8ed125f4..9603e0b7b710e94c689637bd0836282b6ba06bef 100644 (file)
@@ -2,9 +2,9 @@ env GO111MODULE=off
 
 # Test that the user can override default code generation flags.
 
-[gccgo] skip  # gccgo does not use -gcflags
+[compiler:gccgo] skip  # gccgo does not use -gcflags
 [!cgo] skip
-[!linux] skip  # test only works if c-archive implies -shared
+[!GOOS:linux] skip  # test only works if c-archive implies -shared
 [short] skip
 
 env GOCACHE=$WORK/gocache  # Looking for compile commands, so need a clean cache.
index 5b786f2fbce509d86ebac1515ce5845db6ef2aef..0a37d6520c6a7aef39cfcf4f2b7135e2de967bde 100644 (file)
@@ -15,7 +15,7 @@ env GO111MODULE=off
 stderr 'p\.go:3:8: use of internal package .*internal/w not allowed'
 env GO111MODULE=''
 
-[gccgo] skip # gccgo does not have GOROOT
+[compiler:gccgo] skip # gccgo does not have GOROOT
 cd ../testinternal
 ! go build -v .
 stderr 'p\.go:3:8: use of internal package net/http/internal not allowed'
index 8aba7ad7431f46c65b7110423e2a82742c1f3e1b..cacf8f65e513d55c282449d5ac7ed590fe97846d 100644 (file)
@@ -3,7 +3,7 @@
 
 [short] skip
 [!cgo] skip
-[windows] skip  # The Go Windows builders have an extremely out-of-date gcc that does not support reproducible builds; see https://go.dev/issue/50824.
+[GOOS:windows] skip  # The Go Windows builders have an extremely out-of-date gcc that does not support reproducible builds; see https://go.dev/issue/50824.
 
 # This test is sensitive to cache invalidation,
 # so use a separate build cache that we can control.
index cf1e9ea6c24dff535e9372c8dd334a7eba478a14..991112fff118d4bf747a466dbce9fe104a5e2c91 100644 (file)
@@ -3,7 +3,7 @@
 # "go test -c" should also appear to write a new binary every time,
 # even if it's really just updating the mtime on an existing up-to-date binary.
 
-[gccgo] skip
+[compiler:gccgo] skip
 [short] skip
 
 # Install some commands to compare mtimes
index f1de1e4c7129af961d25c5c8190b186354cef612..d47c482170ae28553de014de0a25af816656ac17 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip 'gccgo does not support -ldflags -X'
+[compiler:gccgo] skip 'gccgo does not support -ldflags -X'
 
 go build -o linkx$GOEXE -ldflags -X=my.pkg.Text=linkXworked my.pkg/main
 exec ./linkx$GOEXE
index 1059cad45c7a2bbfeef28a56c69d70fc1a78bbfc..b21e755e8939fb63ab69ecae07280cfc2db655bd 100644 (file)
@@ -7,8 +7,8 @@ env GO111MODULE=off
 env GOCACHE=
 env XDG_CACHE_HOME=
 env HOME=
-[plan9] env home=
-[windows] env LocalAppData=
+[GOOS:plan9] env home=
+[GOOS:windows] env LocalAppData=
 ! go build -o triv triv.go
 stderr 'build cache is required, but could not be located: GOCACHE is not defined and .*'
 
@@ -23,13 +23,13 @@ env GOCACHE=off
 stderr 'build cache is disabled by GOCACHE=off'
 
 # If GOCACHE is set to an unwritable directory, we should diagnose it as such.
-[windows] stop # Does not support unwritable directories.
+[GOOS:windows] stop # Does not support unwritable directories.
 [root] skip # Can write to unwritable directories.
 
 mkdir $WORK/unwritable/home
 chmod 0555 $WORK/unwritable/home
-[!plan9] env HOME=$WORK/unwritable/home
-[plan9] env home=$WORK/unwritable/home
+[!GOOS:plan9] env HOME=$WORK/unwritable/home
+[GOOS:plan9] env home=$WORK/unwritable/home
 
 env GOCACHE=$WORK/unwritable/home
 ! go build -o triv triv.go
index 1e82950dbc1f1a9de1c9b9da768e2ad886bd4233..457960f9ac5641edcf3e6bdf89da32596c54da19 100644 (file)
@@ -1,8 +1,8 @@
-[gccgo] skip 'gccgo has no standard packages'
+[compiler:gccgo] skip 'gccgo has no standard packages'
 [short] skip
 
-[!windows] env NONEXE='.exe'
-[windows] env NONEXE=''
+[!GOOS:windows] env NONEXE='.exe'
+[GOOS:windows] env NONEXE=''
 
 env GOBIN=$WORK/tmp/bin
 go install m/isarchive &
@@ -28,15 +28,15 @@ go build -o bin/ x.go
 exists -exec bin/x$GOEXE
 rm bin
 
-[windows] ! exists bin
-[windows] go build -o bin\x x.go
-[windows] exists -exec bin\x
-[windows] rm bin
+[GOOS:windows] ! exists bin
+[GOOS:windows] go build -o bin\x x.go
+[GOOS:windows] exists -exec bin\x
+[GOOS:windows] rm bin
 
-[windows] ! exists bin
-[windows] go build -o bin\ x.go
-[windows] exists -exec bin\x.exe
-[windows] rm bin
+[GOOS:windows] ! exists bin
+[GOOS:windows] go build -o bin\ x.go
+[GOOS:windows] exists -exec bin\x.exe
+[GOOS:windows] rm bin
 
 ! exists bin
 mkdir bin
index f3eb28202ac96259be5e8182036a3a7116928b43..a14a200b676fc85ddd0a2793c6dbba7dbfb71dbc 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip 'gccgo has no standard packages'
+[compiler:gccgo] skip 'gccgo has no standard packages'
 go build -tags 'tag1 tag2' math
 ! go build -tags 'tag1,tag2 tag3' math
 stderr 'space-separated list contains comma'
\ No newline at end of file
index 3187b4d6439995e7a81aea198ae4d0a4d3f2a8d7..528982442d2c9fed3e70f747ff3ebdeb5f600e71 100644 (file)
@@ -14,7 +14,7 @@ go run ./list-dwarf hello.exe
 stdout gopath[/\\]src
 
 # Check that the source path does not appear when -trimpath is used.
-[aix] stop # can't inspect XCOFF binaries
+[GOOS:aix] stop # can't inspect XCOFF binaries
 go build -trimpath -o hello.exe .
 ! grep -q gopath[/\\]src hello.exe
 go run ./list-dwarf hello.exe
index d61e420279b7b61650161c1ff429cd68ffaf8e7c..8c1212934e1d32bd06c42c4aab9ffeb4d78367af 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip # gccgo assumes cross-compilation is always possible
+[compiler:gccgo] skip # gccgo assumes cross-compilation is always possible
 
 env GOOS=windwos
 
index 975960fd39f7eaad05ac45cb5cbea2e294697a0b..569480051ce2af1f252c1b2790713f43cb707c8d 100644 (file)
@@ -2,9 +2,9 @@ env GO111MODULE=off
 
 # Integration test for cache directory calculation (cmd/go/internal/cache).
 
-[windows] skip
-[darwin] skip
-[plan9] skip
+[GOOS:windows] skip
+[GOOS:darwin] skip
+[GOOS:plan9] skip
 
 mkdir $WORK/gocache
 mkdir $WORK/xdg
index 928024e0340c9c3662f61f291cd4f0d0dc8d6982..6689048f5409ae7585305dc25fde853c5fccfb72 100644 (file)
@@ -2,7 +2,7 @@ env GO111MODULE=off
 
 [short] skip
 [GODEBUG:gocacheverify=1] skip
-[gccgo] skip  # gccgo has no standard packages
+[compiler:gccgo] skip  # gccgo has no standard packages
 
 # Start with a clean build cache:
 # test failures may be masked if the cache has just the right entries already.
index 6bf3beb8e4f79e704364bc25406a3c4f929f84ce..7d28171fad47e708df5a9dc9445ad5469bfddb85 100644 (file)
@@ -4,9 +4,9 @@
 cp x.go.txt x.go
 
 # Only allow //go:cgo_ldflag .* in cgo-generated code
-[gc] cp x_gc.go.txt x.go
-[gc] ! go build x
-[gc] stderr '//go:cgo_ldflag .* only allowed in cgo-generated code'
+[compiler:gc] cp x_gc.go.txt x.go
+[compiler:gc] ! go build x
+[compiler:gc] stderr '//go:cgo_ldflag .* only allowed in cgo-generated code'
 
 # Ignore _* files
 rm x.go
@@ -16,11 +16,11 @@ cp cgo_yy.go.txt _cgo_yy.go
 ! go build .
 stderr 'no Go files' #_* files are ignored...
 
-[gc] ! go build _cgo_yy.go # ... but if forced, the comment is rejected
+[compiler:gc] ! go build _cgo_yy.go # ... but if forced, the comment is rejected
 # Actually, today there is a separate issue that _ files named
 # on the command line are ignored. Once that is fixed,
 # we want to see the cgo_ldflag error.
-[gc] stderr '//go:cgo_ldflag only allowed in cgo-generated code|no Go files'
+[compiler:gc] stderr '//go:cgo_ldflag only allowed in cgo-generated code|no Go files'
 
 rm _cgo_yy.go
 
index 1f84dbc5b40ce3d9d5828566d4d2f2657a9126b0..88f57f0a5b15f6ccd7e4d24940237c0c42c0a5fb 100644 (file)
@@ -8,10 +8,10 @@
 [!exec:clang] [!exec:gcc] skip 'Unknown C compiler'
 
 env GOCACHE=$WORK/gocache  # Looking for compile flags, so need a clean cache.
-[!windows] env PATH=.:$PATH
-[!windows] chmod 0755 p/gcc p/clang
-[!windows] exists -exec p/gcc p/clang
-[windows] exists -exec p/gcc.bat p/clang.bat
+[!GOOS:windows] env PATH=.:$PATH
+[!GOOS:windows] chmod 0755 p/gcc p/clang
+[!GOOS:windows] exists -exec p/gcc p/clang
+[GOOS:windows] exists -exec p/gcc.bat p/clang.bat
 ! exists p/bug.txt
 ! go build -x
 stderr '^cgo: C compiler "(clang|gcc)" not found: exec: "(clang|gcc)": cannot run executable found relative to current directory'
index 654295dc692d95d7a979be6cc5e815cbc7ec3dbe..1a789022a5bcd82d367ee4b5d7a770166023b06d 100644 (file)
 [exec:gcc] env CC=gcc
 [!exec:clang] [!exec:gcc] skip 'Unknown C compiler'
 
-[!windows] chmod 0755 $WORK/'program files'/clang
-[!windows] chmod 0755 $WORK/'program files'/gcc
-[!windows] exists -exec $WORK/'program files'/clang
-[!windows] exists -exec $WORK/'program files'/gcc
-[!windows] env PATH=$WORK/'program files':$PATH
-[windows] exists -exec $WORK/'program files'/gcc.bat
-[windows] exists -exec $WORK/'program files'/clang.bat
-[windows] env PATH=$WORK\'program files';%PATH%
+[!GOOS:windows] chmod 0755 $WORK/'program files'/clang
+[!GOOS:windows] chmod 0755 $WORK/'program files'/gcc
+[!GOOS:windows] exists -exec $WORK/'program files'/clang
+[!GOOS:windows] exists -exec $WORK/'program files'/gcc
+[!GOOS:windows] env PATH=$WORK/'program files':$PATH
+[GOOS:windows] exists -exec $WORK/'program files'/gcc.bat
+[GOOS:windows] exists -exec $WORK/'program files'/clang.bat
+[GOOS:windows] env PATH=$WORK\'program files';%PATH%
 
 ! exists $WORK/log.txt
 ? go build -x
@@ -28,8 +28,8 @@ rm $WORK/log.txt
 # contain spaces separating arguments, and it should be possible to quote
 # arguments with spaces (including the path), as in CGO_CFLAGS and other
 # variables. For now, this doesn't work.
-[!windows] env CC=$WORK/'program files'/gcc
-[windows] env CC=$WORK\'program files'\gcc.bat
+[!GOOS:windows] env CC=$WORK/'program files'/gcc
+[GOOS:windows] env CC=$WORK\'program files'\gcc.bat
 ! go build -x
 ! exists $WORK/log.txt
 
index 80ed751afcd19490db1b3d2d1031bc0a8aced5d0..e446758ed8527d38980c00d6855ad2eb111ad8d1 100644 (file)
@@ -17,8 +17,8 @@ go build -x runtime/cgo
 [!short] stderr '[/\\]cgo'$GOEXE'["]? .* -importpath runtime/cgo'
 
 # https://go.dev/issue/47215: a missing $(go env CC) caused the precompiled net to be stale.
-[!plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
-[plan9] env path=''
+[!GOOS:plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
+[GOOS:plan9] env path=''
 go build -x runtime/cgo
 ! stderr '[/\\]cgo'$GOEXE'["]? .* -importpath runtime/cgo'
 
index 4fb5ccab04e1813617bd8c6b0c5980f3a96c2843..18526c6d311e374f6fd5344b9aa01ce07eed02b3 100644 (file)
@@ -4,7 +4,7 @@ env GO111MODULE=off
 # This test tests that we can link in-package syso files that provides symbols
 # for cgo. See issue 29253.
 [!cgo] stop
-[!gc] stop
+[!compiler:gc] stop
 cc -c -o pkg/o.syso ext.c
 go build main.go
 
index 57f76d6c02890ebfba0202e2c8a08a690c20bdd8..c7b7114b3071240ddfad3edb13b39559116e2410 100644 (file)
@@ -1,5 +1,5 @@
 [short] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 # Test cover for a package that has an assembly function.
 
index 9cf78f71e9fac21484fc1bb1ef68e40fc99c4c45..85754b51825cd0dd79766e1b7e82e9dde7dd2266 100644 (file)
@@ -1,6 +1,6 @@
 [short] skip
 [!cgo] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 # Test coverage on cgo code.
 
index c53b979f9fcfaee7ec85d67b53ce5647be994eb9..afc2178c87be27d46f4c5f6d25f31fe5406456d7 100644 (file)
@@ -1,6 +1,6 @@
 [short] skip
 [!cgo] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 # Test coverage on cgo code. This test case includes an
 # extra empty non-cgo file in the package being checked.
index b501ab02a557ffed85919d43d73c42192a3b2162..ad09baba78717134c1bc349158a0f1449660725b 100644 (file)
@@ -1,6 +1,6 @@
 [short] skip
 [!cgo] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 # Test coverage on cgo code. This test case has an external
 # test that tests the code and an in-package test file with
index 79cc08c4811a65a8699eb5949d5bf422b2ef81b4..0900a48976c381a20c14df48f612b8a90c275dd8 100644 (file)
@@ -1,6 +1,6 @@
 [short] skip
 [!cgo] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 # Test cgo coverage with an external test.
 
index 8950f8d088e747e13de82f0dce86a630217eab48..f28c69e500542db71977ece7233ff85fa3e4fe18 100644 (file)
@@ -1,5 +1,5 @@
 [short] skip
-[gccgo] skip
+[compiler:gccgo] skip
 
 # Test for issue 24588
 
index 36ea6e00b3ef92654667ba19a1d08d1ab160a24a..46748e17cc077dcade8e49dcb27f8efe0bb2f64d 100644 (file)
@@ -1,5 +1,5 @@
 [short] skip
-[gccgo] skip
+[compiler:gccgo] skip
 
 # coverdep2/p1's xtest imports coverdep2/p2 which imports coverdep2/p1.
 # Make sure that coverage on coverdep2/p2 recompiles coverdep2/p2.
index d492e42e2a9265f66a6a96a4698b231d39032760..a336b1c9baca218217b65c98c32158f8f733805b 100644 (file)
@@ -1,5 +1,5 @@
 [short] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 go test -coverpkg=coverdot/a,coverdot/b coverdot/b
 ! stderr '[^0-9]0\.0%'
index 583a664237b007df5bf52c26a8af0e2186b5fff2..15838d5609d15a98a299c4339edaeca77036a818 100644 (file)
@@ -1,5 +1,5 @@
 [short] skip
-[gccgo] skip
+[compiler:gccgo] skip
 
 # Test line numbers in cover errors.
 
index eb6de6778a9bf35e98ba7be6320270644b04610c..36a09c2162fee27c3be9a66239847b8ce164cf85 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 ! go test -n importmain/test
 stderr 'not an importable package' # check that import main was detected
index f8a399d0e6099fe5aa4ce337802aa55ab62fb556..a27296eafa7907083df7bfaecc6d71bd0e9254aa 100644 (file)
@@ -4,7 +4,7 @@ env GO111MODULE=off
 # and should merge coverage profiles correctly.
 
 [short] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 go test -short -cover encoding/binary errors -coverprofile=$WORK/cover.out
 ! stderr '[^0-9]0\.0%'
index ec0850c00374529a3babf7a018395a6f56ab5a53..6c79c10094c395bec6735fe94941e2f342538b9a 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip
+[compiler:gccgo] skip
 
 # If coverpkg=m/sleepy... expands by package loading
 # (as opposed to pattern matching on deps)
index 38a7bb77a56059517b32cbbd1c163242841c9bc4..6df6096563869e19d8db5534195c1334d40ba8de 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip 'gccgo has no cover tool'
+[compiler:gccgo] skip 'gccgo has no cover tool'
 [short] skip
 
 go test -short -coverpkg=strings strings regexp
index 433af9ab738177aa8967f5ed8561c1bc00836e15..ee29bcbaba5fe3154b7657b71a3c8739e0e30048 100644 (file)
@@ -1,5 +1,5 @@
 [short] skip
-[gccgo] skip # gccgo has no cover tool
+[compiler:gccgo] skip # gccgo has no cover tool
 
 go test -short -cover -covermode=atomic -coverpkg=coverdep/p1 coverdep
 
index 7093a8497e145f13ce5c48b129b9850142a53054..ec17ff3827afd662fd45c100a94d091a13bfb2d7 100644 (file)
@@ -1,5 +1,5 @@
 # issue 53314
-[windows] skip
+[GOOS:windows] skip
 cd [pkg]
 go build
 
index 132947c623ff2f0472bad5ac22b9baf99d99cce5..ccd0eb343e292f7d9d7c8059cbfa0a8127a4df68 100644 (file)
@@ -4,14 +4,14 @@ env GO111MODULE=off
 env AppData=$HOME/windowsappdata
 env home=$HOME/plan9home
 go env GOENV
-[aix] stdout $HOME/.config/go/env
-[darwin] stdout $HOME'/Library/Application Support/go/env'
-[freebsd] stdout $HOME/.config/go/env
-[linux] stdout $HOME/.config/go/env
-[netbsd] stdout $HOME/.config/go/env
-[openbsd] stdout $HOME/.config/go/env
-[plan9] stdout $HOME/plan9home/lib/go/env
-[windows] stdout $HOME\\windowsappdata\\go\\env
+[GOOS:aix] stdout $HOME/.config/go/env
+[GOOS:darwin] stdout $HOME'/Library/Application Support/go/env'
+[GOOS:freebsd] stdout $HOME/.config/go/env
+[GOOS:linux] stdout $HOME/.config/go/env
+[GOOS:netbsd] stdout $HOME/.config/go/env
+[GOOS:openbsd] stdout $HOME/.config/go/env
+[GOOS:plan9] stdout $HOME/plan9home/lib/go/env
+[GOOS:windows] stdout $HOME\\windowsappdata\\go\\env
 
 # Now override it to something writable.
 env GOENV=$WORK/envdir/go/env
@@ -36,7 +36,7 @@ stderr 'go: ''go env -u'' requires an argument'
 
 # go env -w changes default setting
 env root=
-[windows] env root=c:
+[GOOS:windows] env root=c:
 env GOPATH=
 go env -w GOPATH=$root/non-exist/gopath
 ! stderr .+
@@ -115,43 +115,43 @@ stderr 'go: GOTMPDIR must be an absolute path'
 
 # go env -w should accept absolute GOTMPDIR value
 # and should not create it
-[windows] go env -w GOTMPDIR=$WORK\x\y\z
-[!windows] go env -w GOTMPDIR=$WORK/x/y/z
+[GOOS:windows] go env -w GOTMPDIR=$WORK\x\y\z
+[!GOOS:windows] go env -w GOTMPDIR=$WORK/x/y/z
 ! exists $WORK/x/y/z
 # we should be able to clear an env
 go env -u GOTMPDIR
 go env GOTMPDIR
 stdout ^$
 
-[windows] go env -w GOTMPDIR=$WORK\x\y\z
-[!windows] go env -w GOTMPDIR=$WORK/x/y/z
+[GOOS:windows] go env -w GOTMPDIR=$WORK\x\y\z
+[!GOOS:windows] go env -w GOTMPDIR=$WORK/x/y/z
 go env -w GOTMPDIR=
 go env GOTMPDIR
 stdout ^$
 
 # go env -w rejects relative CC values
-[!windows] go env -w CC=/usr/bin/clang
+[!GOOS:windows] go env -w CC=/usr/bin/clang
 go env -w CC=clang
-[!windows] ! go env -w CC=./clang
-[!windows] ! go env -w CC=bin/clang
-[!windows] stderr 'go: CC entry is relative; must be absolute path'
+[!GOOS:windows] ! go env -w CC=./clang
+[!GOOS:windows] ! go env -w CC=bin/clang
+[!GOOS:windows] stderr 'go: CC entry is relative; must be absolute path'
 
-[windows] go env -w CC=$WORK\bin\clang
-[windows] ! go env -w CC=.\clang
-[windows] ! go env -w CC=bin\clang
-[windows] stderr 'go: CC entry is relative; must be absolute path'
+[GOOS:windows] go env -w CC=$WORK\bin\clang
+[GOOS:windows] ! go env -w CC=.\clang
+[GOOS:windows] ! go env -w CC=bin\clang
+[GOOS:windows] stderr 'go: CC entry is relative; must be absolute path'
 
 # go env -w rejects relative CXX values
-[!windows] go env -w CC=/usr/bin/cpp
+[!GOOS:windows] go env -w CC=/usr/bin/cpp
 go env -w CXX=cpp
-[!windows] ! go env -w CXX=./cpp
-[!windows] ! go env -w CXX=bin/cpp
-[!windows] stderr 'go: CXX entry is relative; must be absolute path'
-
-[windows] go env -w CXX=$WORK\bin\cpp
-[windows] ! go env -w CXX=.\cpp
-[windows] ! go env -w CXX=bin\cpp
-[windows] stderr 'go: CXX entry is relative; must be absolute path'
+[!GOOS:windows] ! go env -w CXX=./cpp
+[!GOOS:windows] ! go env -w CXX=bin/cpp
+[!GOOS:windows] stderr 'go: CXX entry is relative; must be absolute path'
+
+[GOOS:windows] go env -w CXX=$WORK\bin\cpp
+[GOOS:windows] ! go env -w CXX=.\cpp
+[GOOS:windows] ! go env -w CXX=bin\cpp
+[GOOS:windows] stderr 'go: CXX entry is relative; must be absolute path'
 
 # go env -w/-u checks validity of GOOS/ARCH combinations
 env GOOS=
index 0705277019c991970f4b651fdf7859714fd4f874..918c32d67983e8a1b8739e288fb1edf57b18a013 100644 (file)
@@ -1,6 +1,6 @@
 env GO111MODULE=off
 
-[!gc] skip 'using -gcflags and -ldflags'
+[!compiler:gc] skip 'using -gcflags and -ldflags'
 [short] skip
 
 env GOCACHE=$WORK/gocache  # Looking for compile commands, so need a clean cache.
index 4d31573d5643a0ea48f9488dbf8c1c4aa4a9c759..3da391e2e9d43ebeba8465afd9b18380e9c4b9c4 100644 (file)
@@ -1,4 +1,4 @@
-[windows] skip # skip because windows has no echo command
+[GOOS:windows] skip # skip because windows has no echo command
 
 go generate gencycle
 stdout 'hello world' # check go generate gencycle ran the generator
index 2df16633765fa92d3543d581c9094488bbcd8491..cb76d30e9b1b717305cf7af1a7c7368f2b6706f0 100644 (file)
@@ -1,8 +1,8 @@
 # Install an env command because Windows and plan9 don't have it.
 env GOBIN=$WORK/tmp/bin
 go install env.go
-[plan9] env path=$GOBIN${:}$path
-[!plan9] env PATH=$GOBIN${:}$PATH
+[GOOS:plan9] env path=$GOBIN${:}$path
+[!GOOS:plan9] env PATH=$GOBIN${:}$PATH
 
 # Test generators have access to the environment
 go generate ./printenv.go
index 647cea3bf95302cf87b1c350e531a50c744bbb4a..24591f0074281916bddb1500471e542e846c8b5c 100644 (file)
@@ -4,12 +4,12 @@
 
 [short] skip
 
-[!plan9] env PATH=
-[plan9] env path=
+[!GOOS:plan9] env PATH=
+[GOOS:plan9] env path=
 go generate .
 
-[!plan9] env PATH=$WORK${/}bin
-[plan9] env path=$WORK${/}bin
+[!GOOS:plan9] env PATH=$WORK${/}bin
+[GOOS:plan9] env path=$WORK${/}bin
 go generate .
 
 -- go.mod --
index 929435ad70c1036d6a2ab2137a2b529589d20bd2..dc1e5adccf1f9825a0e25e9dc0cc7b08a6675835 100644 (file)
@@ -28,25 +28,25 @@ stderr '\$GOPATH must not be set to \$GOROOT'
 mkdir $WORK/home/go
 
 # Fails because GOROOT=$HOME/go so default GOPATH unset.
-[windows] env USERPROFILE=$WORK/home
-[plan9] env home=$WORK/home
-[!windows] [!plan9] env HOME=$WORK/home
+[GOOS:windows] env USERPROFILE=$WORK/home
+[GOOS:plan9] env home=$WORK/home
+[!GOOS:windows] [!GOOS:plan9] env HOME=$WORK/home
 env GOPATH=
 env GOROOT=$WORK/home/go
 ! go get -d github.com/golang/example/hello
 stderr '\$GOPATH not set'
 
-[windows] env USERPROFILE=$WORK/home/
-[plan9] env home=$WORK/home/
-[!windows] [!plan9] env HOME=$WORK/home/
+[GOOS:windows] env USERPROFILE=$WORK/home/
+[GOOS:plan9] env home=$WORK/home/
+[!GOOS:windows] [!GOOS:plan9] env HOME=$WORK/home/
 env GOPATH=
 env GOROOT=$WORK/home/go
 ! go get -d github.com/golang/example/hello
 stderr '\$GOPATH not set'
 
-[windows] env USERPROFILE=$WORK/home
-[plan9] env home=$WORK/home
-[!windows] [!plan9] env HOME=$WORK/home
+[GOOS:windows] env USERPROFILE=$WORK/home
+[GOOS:plan9] env home=$WORK/home
+[!GOOS:windows] [!GOOS:plan9] env HOME=$WORK/home
 env GOPATH=
 env GOROOT=$WORK/home/go/
 ! go get -d github.com/golang/example/hello
index 54beaca5e8a9c211db89a82d3d729a673880c1dc..efde0e707f4779761f8084d0b9a968de5b80bfee 100644 (file)
@@ -24,7 +24,7 @@ stdout '^sub\.Hello'
 ! go install testdata/local/easy.go
 stderr '^go: no install location for \.go files listed on command line \(GOBIN not set\)$'
 
-[windows] stop  # Windows does not allow the ridiculous directory name we're about to use.
+[GOOS:windows] stop  # Windows does not allow the ridiculous directory name we're about to use.
 
 env BAD_DIR_NAME='#$%:, &()*;<=>?\^{}'
 
index a0a41a50de328db92f7d6985cf476a120eb49666..4aaf46b5d0f0dc55335ea648469dd716488241fa 100644 (file)
@@ -1,6 +1,6 @@
 env GO111MODULE=off
 
-[!gc] skip
+[!compiler:gc] skip
 
 go list -f '{{.Dir}}' vendor/golang.org/x/net/http2/hpack
 stdout $GOPATH[/\\]src[/\\]vendor
index fdbcde06cbcee181b1d832d4bd6463e269167145..1a0e23e375bd5afbb5ebee20d2281d87775b7048 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip
+[compiler:gccgo] skip
 
 mkdir $WORK/new/bin
 
index 33d48fce89915cbd53272e87dc07ba55e8c2bc00..7679a7e224aac1137f83f5c77899afa3557ed92f 100644 (file)
@@ -6,7 +6,7 @@ go build mycmd
 
 # cross-compile install with implicit GOBIN=$GOPATH/bin can make subdirectory
 env GOARCH=386
-[386] env GOARCH=amd64
+[GOARCH:386] env GOARCH=amd64
 env GOOS=linux
 go install mycmd
 exists $GOPATH/bin/linux_$GOARCH/mycmd
index c713304d9fdde16e74fdfb92d4fd422132be8177..6bb9005577044c443bd527dcde01653395179552 100644 (file)
@@ -1,12 +1,12 @@
 # Test that syso in deps is available to cgo.
 
-[!gc] skip 'requires syso support'
+[!compiler:gc] skip 'requires syso support'
 [!cgo] skip
 [short] skip 'invokes system C compiler'
 
 # External linking is not supported on linux/ppc64.
 # See: https://github.com/golang/go/issues/8912
-[linux] [ppc64] skip
+[GOOS:linux] [GOARCH:ppc64] skip
 
 cc -c -o syso/x.syso syso/x.c
 cc -c -o syso2/x.syso syso2/x.c
index 36746e64993cb877d4664fbb7fa4a72d1c268e58..b0d4a7c68c75377b829015da0e16d3e75d755572 100644 (file)
@@ -2,13 +2,13 @@
 # embedded in a package, that is referenced by a Go assembly function.
 # See issue 33139.
 
-[!gc] skip
+[!compiler:gc] skip
 [!cgo] skip
 [short] skip 'invokes system C compiler'
 
 # External linking is not supported on linux/ppc64.
 # See: https://github.com/golang/go/issues/8912
-[linux] [ppc64] skip
+[GOOS:linux] [GOARCH:ppc64] skip
 
 cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
 go build -ldflags='-linkmode=external' ./cmd/main.go
index 11336594d3596ba8a203bdc1099d90d63bc054b1..36ac8ebccd4d11de331a41a6f684d4cfc082f9f3 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=off
 
 # check for linker name in error message about linker crash
-[!gc] skip
+[!compiler:gc] skip
 ! go build -ldflags=-crash_for_testing x.go
 stderr [\\/]tool[\\/].*[\\/]link
 
index 82dde4538029eaf74aa15001e438fcf2c18d52db..6f22314ffa1a54f00bcf6e6462e9315ff6a02f7c 100644 (file)
@@ -22,9 +22,9 @@ stderr '^stat .*[/\\]foo\.go[/\\]b\.go: directory not found$'
 # Multiple patterns for Go files with a typo. This should
 # treat the wrong pattern as if it were a nonexistent file.
 ! go list ./foo.go/a.go ./foo.go/b.go
-[plan9] stderr 'stat ./foo.go/b.go: ''./foo.go/b.go'' does not exist'
-[windows] stderr './foo.go/b.go: The system cannot find the file specified'
-[!plan9] [!windows] stderr './foo.go/b.go: no such file or directory'
+[GOOS:plan9] stderr 'stat ./foo.go/b.go: ''./foo.go/b.go'' does not exist'
+[GOOS:windows] stderr './foo.go/b.go: The system cannot find the file specified'
+[!GOOS:plan9] [!GOOS:windows] stderr './foo.go/b.go: no such file or directory'
 
 -- a.go --
 package main
index 6e48d7b42c3094a1d4a0bc82bf9cdbf2a73358b2..b4ff3cbf6d24682f168b8491df76d84fd1b2d97f 100644 (file)
@@ -36,8 +36,8 @@ env GO111MODULE=off
 go list ./...
 stdout -count=2 '^.+$' # Both 'fmt' and GOROOT/src should be listed.
 stdout '^fmt$'
-[!windows] stdout ^_$WORK/goroot/src$
-[windows] stdout goroot/src$ # On windows the ":" in the volume name is mangled
+[!GOOS:windows] stdout ^_$WORK/goroot/src$
+[GOOS:windows] stdout goroot/src$ # On windows the ":" in the volume name is mangled
 
 go list ...
 ! stdout goroot/src
@@ -46,8 +46,8 @@ go list std
 ! stdout goroot/src
 
 go list .
-[!windows] stdout ^_$WORK/goroot/src$
-[windows] stdout goroot/src$
+[!GOOS:windows] stdout ^_$WORK/goroot/src$
+[GOOS:windows] stdout goroot/src$
 
 # switch to GOPATH/src
 cd $GOPATH/src
@@ -55,8 +55,8 @@ cd $GOPATH/src
 # GO111MODULE=off,GOPATH
 env GO111MODULE=off
 go list ./...
-[!windows] stdout ^_$WORK/gopath/src$
-[windows] stdout gopath/src$
+[!GOOS:windows] stdout ^_$WORK/gopath/src$
+[GOOS:windows] stdout gopath/src$
 
 go list all
 ! stdout gopath/src
index f424b9814c6129506f0ddc399e2a80d156ea1771..3c59cfdd1166576996c92bdb0c4430109e0e3fc2 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=off
 
 # gccgo does not have standard packages.
-[gccgo] skip
+[compiler:gccgo] skip
 
 # fmt should have no rewritten imports.
 # The import from a/b should map c/d to a's vendor directory.
index 3b850ef3cc80740da01d4a9a8f3b1316f5a1549b..14d6f7211d4a2518ebbaf465705afd2a45fe0e0c 100644 (file)
@@ -16,8 +16,8 @@ stderr 'matched no packages'
 # equivalent to an empty directory).
 
 [root] stop # Root typically ignores file permissions.
-[windows] skip # Does not have Unix-style directory permissions.
-[plan9] skip   # Might not have Unix-style directory permissions.
+[GOOS:windows] skip # Does not have Unix-style directory permissions.
+[GOOS:plan9] skip   # Might not have Unix-style directory permissions.
 
 chmod 000 noread
 
index b3ff2a7c2d65cfdc5e6f07944e624f1936b6722f..8b71921e4e51821effcd4ef65f27837aedaaa4e2 100644 (file)
@@ -3,7 +3,7 @@
 # whether the modindex logic cleans the modroot path before using
 # it.
 
-[!windows] skip
+[!GOOS:windows] skip
 [short] skip
 
 go run print_go_mod.go # use this program to write a go.mod with an absolute path
index 6ab1bd1674c99433106d200602c0cb5a897b5722..64c47664a88f5319fa9ecd71e4d927f39d5a5373 100644 (file)
@@ -1,6 +1,6 @@
 env GO111MODULE=off
 
-[!gc] skip
+[!compiler:gc] skip
 [short] skip
 
 # Listing GOROOT should only find standard packages.
index 4220487a28642416e4b214d4810bf981affac3b7..731c1e5a7bcf4f7955ae7ee77fa2bd368ce0e51b 100644 (file)
@@ -16,8 +16,8 @@
 go list -f '{{.CompiledGoFiles}}' -compiled=true example/swig
 
 stdout a\.go
-[gc] stdout -count=3 $GOCACHE
-[gccgo] stdout -count=2 $GOCACHE
+[compiler:gc] stdout -count=3 $GOCACHE
+[compiler:gccgo] stdout -count=2 $GOCACHE
 
 -- go.mod --
 module example
index 07755415d608a46748b658ae808f67e575ec5d9b..87f27e87de5872620627326779c8bc44f4007543 100644 (file)
@@ -17,10 +17,10 @@ cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
 
 # If all 'go' commands ran with the flag, the system's 'rm' binary
 # should be able to remove the module cache if the '-rf' flags are set.
-[!windows] [exec:rm] exec rm -rf $GOPATH/pkg/mod
-[!windows] [!exec:rm] go clean -modcache
-[windows] [exec:cmd.exe] exec cmd.exe /c rmdir /s /q $GOPATH\pkg\mod
-[windows] [!exec:cmd.exe] go clean -modcache
+[!GOOS:windows] [exec:rm] exec rm -rf $GOPATH/pkg/mod
+[!GOOS:windows] [!exec:rm] go clean -modcache
+[GOOS:windows] [exec:cmd.exe] exec cmd.exe /c rmdir /s /q $GOPATH\pkg\mod
+[GOOS:windows] [!exec:cmd.exe] go clean -modcache
 ! exists $GOPATH/pkg/mod
 
 # The directories in the module cache should by default be unwritable,
@@ -30,7 +30,7 @@ cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
 # unwritable.
 go get rsc.io/quote@latest
 [!root] ! cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/go.mod
-[!windows] [!root] ! cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
+[!GOOS:windows] [!root] ! cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
 ! exists $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
 
 
index 57470a95c4c9efb579837b593a1c4660a71cda89..83d53926eed4743a7944aae1a42cd32ac0f3f961 100644 (file)
@@ -4,7 +4,7 @@
 # Remove 'go' from $PATH. (It can still be located via $GOROOT/bin/go, and the
 # test script's built-in 'go' command still knows where to find it.)
 env PATH=''
-[plan9] env path=''
+[GOOS:plan9] env path=''
 
 go doc p.X
 
index 231babd0c09cbaa35cc94d2ffa5f2a26cec2b197..c2c8b1826fbd5a59ff61111916c9b649a494ba2c 100644 (file)
@@ -10,7 +10,7 @@
 # Since 1.16, we extract to the final directory, but we create a .partial file
 # so that if we crash, other processes know the directory is incomplete.
 
-[!windows] skip
+[!GOOS:windows] skip
 [short] skip
 
 go run downloader.go
index 2aa3c2d19a61d8c9d3a67b43eb35d1b0dd66cd28..68cce8ca262b5072d4b89d698cf5da6a763c6d2f 100644 (file)
@@ -1,7 +1,7 @@
 [short] skip
 [!git] skip
 [!net] skip
-[!linux] skip  # Uses XDG_CONFIG_HOME
+[!GOOS:linux] skip  # Uses XDG_CONFIG_HOME
 
 env GIT_CONFIG_GLOBAL=$WORK/.gitconfig
 env GOPROXY=direct
index 38d9fd25fbebeb8c4e0d62a77e2632e4161e46ec..ebc28a0015a324211b144f3929482b40b2289093 100644 (file)
@@ -12,11 +12,11 @@ grep v1.5.1 $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/list
 
 # Use download cache as file:/// proxy.
 env GOPATH=$WORK/gopath2
-[windows] env GOPROXY=file:///C:/nonexist
-[!windows] env GOPROXY=file:///nonexist
+[GOOS:windows] env GOPROXY=file:///C:/nonexist
+[!GOOS:windows] env GOPROXY=file:///nonexist
 ! go list
-[windows] env GOPROXY=file:///$WORK/gopath1/pkg/mod/cache/download
-[!windows] env GOPROXY=file://$WORK/gopath1/pkg/mod/cache/download
+[GOOS:windows] env GOPROXY=file:///$WORK/gopath1/pkg/mod/cache/download
+[!GOOS:windows] env GOPROXY=file://$WORK/gopath1/pkg/mod/cache/download
 go list
 grep v1.5.1 $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/list
 
index 2db39783a21c2d961c865ae8ee5b37988470b943..633bd8b7b11634ba9a109e5315720d2b29ac78cf 100644 (file)
@@ -9,8 +9,8 @@ cd $WORK/x
 go mod tidy
 
 # Use download cache as file:/// proxy.
-[windows] env GOPROXY=file:///$WORK/gopath/pkg/mod/cache/download
-[!windows] env GOPROXY=file://$WORK/gopath/pkg/mod/cache/download
+[GOOS:windows] env GOPROXY=file:///$WORK/gopath/pkg/mod/cache/download
+[!GOOS:windows] env GOPROXY=file://$WORK/gopath/pkg/mod/cache/download
 rm $WORK/gopath/pkg/mod/cache/download/golang.org/x/text/
 go mod tidy -e
 stderr '^go: rsc.io/sampler@v1.3.0 requires\n\tgolang.org/x/text@.*: reading file://.*/pkg/mod/cache/download/golang.org/x/text/.*'
@@ -39,4 +39,4 @@ import (
 
 func Echo() {
        fmt.Println(quote.Hello())
-}
\ No newline at end of file
+}
index bafa5876241ece08b9e06340673761bf912ce7bf..bfc6cb1c797316fa9e15ee154fe2dcfe40fe3620 100644 (file)
@@ -23,9 +23,9 @@ exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.0.0.info
 grep '{"Version":"v1.0.0","Time":"2018-02-14T00:45:20Z"}' $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.0.0.info
 
 # If neither GOMODCACHE or GOPATH are set, GOPATH defaults to the user's $HOME/go, so GOMODCACHE becomes $HOME/go/pkg/mod
-[windows] env USERPROFILE=$WORK/home # Ensure USERPROFILE is a valid path (rather than /no-home/ so we don't run into the logic that "uninfers" GOPATH in cmd/go/main.go
-[plan9] env home=$WORK/home
-[!windows] [!plan9] env HOME=$WORK/home
+[GOOS:windows] env USERPROFILE=$WORK/home # Ensure USERPROFILE is a valid path (rather than /no-home/ so we don't run into the logic that "uninfers" GOPATH in cmd/go/main.go
+[GOOS:plan9] env home=$WORK/home
+[!GOOS:windows] [!GOOS:plan9] env HOME=$WORK/home
 env GOMODCACHE=
 env GOPATH=
 go env GOMODCACHE
index f4e0433d8a0e171f585673c3664306a20fcc49b6..51f8241b5005d04c7442b7e5424dd094dbd712d5 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=on
 env GOPROXY=off
 
-[!gc] skip
+[!compiler:gc] skip
 [short] skip
 
 # Outside of GOROOT, our vendored packages should be reported as part of the standard library.
index f5382eceaf67ca244f9997f37e807564bb0535e0..2972f46601c0ebedb164866b33851daccd75af04 100644 (file)
@@ -5,8 +5,8 @@ go list ./...
 # skip in conditions where chmod 0 may not work.
 # plan9 should be fine, but copied from list_perm.txt unchanged.
 [root] skip
-[windows] skip
-[plan9] skip
+[GOOS:windows] skip
+[GOOS:plan9] skip
 
 # go list should work with unreadable _data directory.
 chmod 0 _data
index 77e2508cb7f3b13a6998ddcb89bab5431e32d0d5..b523e6ac778204140046fef0da8db2046ddeb580 100644 (file)
@@ -5,8 +5,8 @@ env GO111MODULE=on
 [short] skip
 
 # Skip platforms that do not have Unix-style file permissions.
-[windows] skip
-[plan9] skip
+[GOOS:windows] skip
+[GOOS:plan9] skip
 
 chmod 0640 go.mod
 chmod 0604 go.sum
index c3cde52953f86b023ecd1b8c854e3ec65dbf18ca..82e48b6f197163955b4ed5b674a1e283da139910 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=on
 env GOPROXY=off
 
-[!gc] skip
+[!compiler:gc] skip
 
 # 'go list' should report imports from _test.go in the TestImports field.
 go list -f '{{.TestImports}}'
index a834c4800dcf5fa352fff8a1f35797a865a367d9..d89ad1aa338c752faf239bada5a4d31092c814e4 100644 (file)
@@ -10,23 +10,23 @@ env GOPATH=$WORK/gopath1
 #
 # TODO(bcmills): The error message here is a bit redundant.
 # It comes from the sumweb package, which isn't yet producing structured errors.
-[windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
-[!windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
+[GOOS:windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
+[!GOOS:windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
 ! go get golang.org/x/text@v0.3.2
 stderr '^go: golang.org/x/text@v0.3.2: verifying module: golang.org/x/text@v0.3.2: reading file://.*/sumdb/sum.golang.org/lookup/golang.org/x/text@v0.3.2: (no such file or directory|.*cannot find the path specified.*)'
 
 # If the proxy does not claim to support the database,
 # checksum verification should fall through to the next proxy,
 # and downloading should succeed.
-[windows] env GOPROXY=file:///$WORK/emptyproxy,https://proxy.golang.org
-[!windows] env GOPROXY=file://$WORK/emptyproxy,https://proxy.golang.org
+[GOOS:windows] env GOPROXY=file:///$WORK/emptyproxy,https://proxy.golang.org
+[!GOOS:windows] env GOPROXY=file://$WORK/emptyproxy,https://proxy.golang.org
 go get golang.org/x/text@v0.3.2
 
 # After a successful sumdb lookup, the lookup can be repeated
 # using the download cache as a proxy.
 cp supported $GOPATH/pkg/mod/cache/download/sumdb/sum.golang.org/supported
-[windows] env GOPROXY=file:///$WORK/gopath1/pkg/mod/cache/download,file:///$WORK/sumproxy
-[!windows] env GOPROXY=file://$WORK/gopath1/pkg/mod/cache/download,file://$WORK/sumproxy
+[GOOS:windows] env GOPROXY=file:///$WORK/gopath1/pkg/mod/cache/download,file:///$WORK/sumproxy
+[!GOOS:windows] env GOPROXY=file://$WORK/gopath1/pkg/mod/cache/download,file://$WORK/sumproxy
 env GOPATH=$WORK/gopath2
 rm go.sum
 go get -x -v golang.org/x/text@v0.3.2
@@ -36,11 +36,11 @@ go get -x -v golang.org/x/text@v0.3.2
 # a fallback module mirror.
 grep golang.org/x/text go.sum
 env GOPATH=$WORK/gopath3
-[windows] env GOPROXY=file:///$WORK/sumproxy
-[!windows] env GOPROXY=file://$WORK/sumproxy
+[GOOS:windows] env GOPROXY=file:///$WORK/sumproxy
+[!GOOS:windows] env GOPROXY=file://$WORK/sumproxy
 ! go get golang.org/x/text@v0.3.2
-[windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
-[!windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
+[GOOS:windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
+[!GOOS:windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
 go get golang.org/x/text@v0.3.2
 
 -- supported --
index 635a336bcaf0fe88d3006f899ccb89ced32f1927..8a2fa4ec10449120fb51db94ed4738f8273d3bd3 100644 (file)
@@ -4,7 +4,7 @@
 # 1. /tmp/go.mod exists
 # 2. run 'go mod tidy' in /tmp or in the child directory not having go.mod.
 
-[plan9] stop  # Plan 9 has no $TMPDIR variable to set.
+[GOOS:plan9] stop  # Plan 9 has no $TMPDIR variable to set.
 
 env GOROOT=$TESTGO_GOROOT
 env TMP=$WORK
index 6cb015fc0778dd14ffe58509c7f53c8a6a66f84e..731ee9e670de80007f9189f536808838a3ee01e9 100644 (file)
@@ -1,6 +1,6 @@
 env GO111MODULE=off
 
-[!gc] skip
+[!compiler:gc] skip
 
 # 'go list' should report imports from _test.go in the TestImports field.
 go list -f '{{.TestImports}}'
index 3e3a1c7b0d60c680392112056ff7563d3b052d17..5828e86136792bb4d3f33c53a1c0d6dc3ffda687 100644 (file)
@@ -1,6 +1,6 @@
 [short] skip 'links and runs a test binary'
 [!fuzz] skip 'tests SIGINT behavior for interrupting fuzz tests'
-[windows] skip 'windows does not support os.Interrupt'
+[GOOS:windows] skip 'windows does not support os.Interrupt'
 
 ? go test -json -fuzz FuzzInterrupt -run '^$' -parallel 1
 stdout -count=1 '"Action":"pass","Package":"example","Test":"FuzzInterrupt"'
@@ -52,4 +52,4 @@ func FuzzInterrupt(f *testing.F) {
                        }
                }
        })
-}
\ No newline at end of file
+}
index 3764dcb9157a7fd86ac617abd67f8e83c7b90dd7..b413f938a68a6628319fc237560ede467c940ed4 100644 (file)
@@ -1,5 +1,5 @@
 # TODO(jayconrod): support shared memory on more platforms.
-[!darwin] [!linux] [!windows] skip
+[!GOOS:darwin] [!GOOS:linux] [!GOOS:windows] skip
 
 # Verify that the fuzzing engine records the actual crashing input, even when
 # a worker process terminates without communicating the crashing input back
index 1051292fcb847ee796c4a0608bf5138abe58879b..6f1eeab42407f62566a517f870109be3c89f1e29 100644 (file)
@@ -1,6 +1,6 @@
 # NOTE: this test is skipped on Windows, since there's no concept of signals.
 # When a process terminates another process, it provides an exit code.
-[windows] skip
+[GOOS:windows] skip
 [!fuzz] skip
 [short] skip
 
index f49ec106ff56fc54725c26e903ef45b89da8cbaf..a6278ca749e6020aef49cc4db6b4dd2a9fc72406 100644 (file)
@@ -4,12 +4,12 @@
 
 [short] skip
 
-[!plan9] env PATH=
-[plan9] env path=
+[!GOOS:plan9] env PATH=
+[GOOS:plan9] env path=
 go test .
 
-[!plan9] env PATH=$WORK${/}bin
-[plan9] env path=$WORK${/}bin
+[!GOOS:plan9] env PATH=$WORK${/}bin
+[GOOS:plan9] env path=$WORK${/}bin
 go test .
 
 -- go.mod --
index cd5b0b9d7a5293269c6bfe5f09d66e80f7ed678a..f2bee34ce2c8d2bbcdb6a779785ecd203e9d345c 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip # gccgo does not have standard packages
+[compiler:gccgo] skip # gccgo does not have standard packages
 [short] skip
 
 env GOCACHE=$WORK/tmp
index a33f9df724d1599d041350df8870f0b9e68d0831..735b5dcc7f69567b348d54d77e5c2c61ae9fb46c 100644 (file)
@@ -5,10 +5,10 @@
 # -Os option.
 #
 # Verifies golang.org/issue/52366 for linux/ppc64le
-[!linux] skip
-[!gc] skip
+[!GOOS:linux] skip
+[!compiler:gc] skip
 [!cgo] skip
-[!ppc64le] skip
+[!GOARCH:ppc64le] skip
 
 go build -ldflags='-linkmode=internal'
 exec ./abitest
index 7a9cd7b6d8f11a1626f26df3eaaa6e99170c7bdc..ef9ff03592c3d34720142baa40191fd8e339a255 100644 (file)
@@ -8,9 +8,9 @@
 #
 # Note, older gcc/clang may accept this option, but
 # ignore it if binutils does not support the relocs.
-[!gc] skip
+[!compiler:gc] skip
 [!cgo] skip
-[!ppc64le] skip
+[!GOARCH:ppc64le] skip
 
 env CGO_CFLAGS='-fno-plt -O2 -g'
 
index 4bfa2cc493e20e2184edddd3d5a4bd6629e042b8..9110706f083d29cf365407defa265e6140e30b99 100644 (file)
@@ -1,4 +1,4 @@
-[gccgo] skip 'gccgo has no standard packages'
+[compiler:gccgo] skip 'gccgo has no standard packages'
 [short] skip
 
 # Check go test -cpuprofile creates errors.test
index bb86467942b9fd240c3f0579818564672d607e1f..20a596805206c77191be491c7f1a81458e2c0bee 100644 (file)
@@ -17,7 +17,7 @@ env GOCACHE=$WORK/gocache
 # Finally, note that asm and cgo are run twice.
 
 go build -toolexec=$PWD/mytool
-[amd64] stderr -count=2 '^asm'${GOEXE}' TOOLEXEC_IMPORTPATH="test/main/withasm"$'
+[GOARCH:amd64] stderr -count=2 '^asm'${GOEXE}' TOOLEXEC_IMPORTPATH="test/main/withasm"$'
 stderr -count=1 '^compile'${GOEXE}' TOOLEXEC_IMPORTPATH="test/main/withasm"$'
 [cgo] stderr -count=2 '^cgo'${GOEXE}' TOOLEXEC_IMPORTPATH="test/main/withcgo"$'
 [cgo] stderr -count=1 '^compile'${GOEXE}' TOOLEXEC_IMPORTPATH="test/main/withcgo"$'
index da52f9acf2dca2ac4cb45b9aaece72563354c481..c85f67421a9d67de35d142ca2946840ff59bfd37 100644 (file)
@@ -1,4 +1,4 @@
-[!windows] [short] stop 'this test only applies to Windows'
+[!GOOS:windows] [short] stop 'this test only applies to Windows'
 env GO111MODULE=off
 
 go build run_go.go
index 839aa8526c6cfd7829a5f652d6ce809a9b7f33d7..0a2ac1e1d58f30651ecdbd5fa804d0547090610a 100644 (file)
@@ -69,8 +69,8 @@ stdout '^\tmod\trsc.io/fortune\tv1.0.0'
 
 # Also test PIE with internal linking.
 # currently only supported on linux/amd64, linux/arm64 and windows/amd64.
-[!linux] [!windows] stop
-[!amd64] [!arm64] stop
+[!GOOS:linux] [!GOOS:windows] stop
+[!GOARCH:amd64] [!GOARCH:arm64] stop
 go build -buildmode=pie -ldflags=-linkmode=internal -o internal.exe rsc.io/fortune
 go version internal.exe
 stdout '^internal.exe: .+'
index bfa7f5fbbe6d100da0377fec51a06f21545e87e0..cd3f5cfed2c7c960061a45520bd24e6356c2fa6b 100644 (file)
@@ -6,7 +6,7 @@ go version -m m$GOEXE
 stdout '^\tbuild\t-compiler=gc$'
 stdout '^\tbuild\tGOOS='
 stdout '^\tbuild\tGOARCH='
-[amd64] stdout '^\tbuild\tGOAMD64='
+[GOARCH:amd64] stdout '^\tbuild\tGOAMD64='
 ! stdout asmflags|gcflags|ldflags|gccgoflags
 
 # Toolchain flags are added if present.
index 720306868bc3c6f424768e7c7b4f691a5ffd2341..45b5baeaf7a1b1216c58dddb8e86c851d753d264 100644 (file)
@@ -3,15 +3,15 @@
 # The Git test covers common functionality.
 
 # "fossil" is the Fossil file server on Plan 9.
-[plan9] skip
+[GOOS:plan9] skip
 [!exec:fossil] skip
 [short] skip
 env GOBIN=$WORK/gopath/bin
 env oldpath=$PATH
 env HOME=$WORK
 env USER=gopher
-[!windows] env fslckout=.fslckout
-[windows] env fslckout=_FOSSIL_
+[!GOOS:windows] env fslckout=.fslckout
+[GOOS:windows] env fslckout=_FOSSIL_
 exec pwd
 exec fossil init repo.fossil
 cd repo/a
index 59b35ec7c285890b11d7309aec89d063043dbc57..ae2db97794f040b348be0f522b1e626836b7a02a 100644 (file)
@@ -2,7 +2,7 @@ env GO111MODULE=off
 
 # Issue 27665. Verify that "go vet" analyzes non-Go files.
 
-[!amd64] skip
+[!GOARCH:amd64] skip
 ! go vet -asmdecl a
 stderr 'f: invalid MOVW of x'