github.com/zxy12/go_duplicate_112_new@v0.0.0-20200807091221-747231827200/src/cmd/go/testdata/script/build_cache_output.txt (about) 1 [!gc] skip 2 3 # Set up fresh GOCACHE. 4 env GOCACHE=$WORK/gocache 5 mkdir $GOCACHE 6 7 # Building a trivial non-main package should run compiler the first time. 8 go build -x -gcflags=-m lib.go 9 stderr 'compile( |\.exe"?)' 10 stderr 'lib.go:2.* can inline f' 11 12 # ... but not the second, even though it still prints the compiler output. 13 go build -x -gcflags=-m lib.go 14 ! stderr 'compile( |\.exe"?)' 15 stderr 'lib.go:2.* can inline f' 16 17 # Building a trivial main package should run the compiler and linker the first time. 18 go build -x -gcflags=-m -ldflags='-v -w' main.go 19 stderr 'compile( |\.exe"?)' 20 stderr 'main.go:2.* can inline main' # from compiler 21 stderr 'link(\.exe"?)? -' 22 stderr '\d+ symbols' # from linker 23 24 # ... but not the second, even though it still prints the compiler and linker output. 25 go build -x -gcflags=-m -ldflags='-v -w' main.go 26 ! stderr 'compile( |\.exe"?)' 27 stderr 'main.go:2.* can inline main' # from compiler 28 ! stderr 'link(\.exe"?)? -' 29 stderr '\d+ symbols' # from linker 30 31 # Running a test should run the compiler, linker, and the test the first time. 32 go test -v -x -gcflags=-m -ldflags=-v p_test.go 33 stderr 'compile( |\.exe"?)' 34 stderr 'p_test.go:.*can inline Test' # from compile of p_test 35 stderr 'testmain\.go:.*inlin' # from compile of testmain 36 stderr 'link(\.exe"?)? -' 37 stderr '\d+ symbols' # from linker 38 stderr 'p\.test( |\.exe"?)' 39 stdout 'TEST' # from test 40 41 # ... but not the second, even though it still prints the compiler, linker, and test output. 42 go test -v -x -gcflags=-m -ldflags=-v p_test.go 43 ! stderr 'compile( |\.exe"?)' 44 stderr 'p_test.go:.*can inline Test' # from compile of p_test 45 stderr 'testmain\.go:.*inlin' # from compile of testmain 46 ! stderr 'link(\.exe"?)? -' 47 stderr '\d+ symbols' # from linker 48 ! stderr 'p\.test( |\.exe"?)' 49 stdout 'TEST' # from test 50 51 52 -- lib.go -- 53 package p 54 func f(x *int) *int { return x } 55 56 -- main.go -- 57 package main 58 func main() {} 59 60 -- p_test.go -- 61 package p 62 import "testing" 63 func Test(t *testing.T) {println("TEST")}