...

Text file src/cmd/go/testdata/script/build_cache_link.txt

Documentation: cmd/go/testdata/script

     1env GO111MODULE=off
     2[short] skip
     3
     4# Set up fresh GOCACHE.
     5env GOCACHE=$WORK/gocache
     6mkdir $GOCACHE
     7
     8# Building a main package should run the compiler and linker ...
     9go build -o $devnull -x main.go
    10stderr '(compile|gccgo)( |\.exe).*main\.go'
    11stderr '(link|gccgo)( |\.exe)'
    12
    13# ... and then the linker again ...
    14go build -o $devnull -x main.go
    15! stderr '(compile|gccgo)( |\.exe).*main\.go'
    16stderr '(link|gccgo)( |\.exe)'
    17
    18# ... but the output binary can serve as a cache.
    19go build -o main$GOEXE -x main.go
    20stderr '(link|gccgo)( |\.exe)'
    21go build -o main$GOEXE -x main.go
    22! stderr '(link|gccgo)( |\.exe)'
    23
    24-- main.go --
    25package main
    26func main() {}

View as plain text