summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/script/build_cache_link.txt
blob: 61e7ee46d3a78d8ff3792ab96e3f2faed4f69661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Set up fresh GOCACHE.
env GOCACHE=$WORK/gocache
mkdir $GOCACHE

# Building a main package should run the compiler and linker ...
go build -o $devnull -x main.go
stderr '(compile|gccgo)( |\.exe).*main\.go'
stderr '(link|gccgo)( |\.exe)'

# ... and then the linker again ...
go build -o $devnull -x main.go
! stderr '(compile|gccgo)( |\.exe).*main\.go'
stderr '(link|gccgo)( |\.exe)'

# ... but the output binary can serve as a cache.
go build -o main$exe -x main.go
stderr '(link|gccgo)( |\.exe)'
go build -o main$exe -x main.go
! stderr '(link|gccgo)( |\.exe)'

-- main.go --
package main
func main() {}