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

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

View as plain text