We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70ebb76 commit dbcf0cbCopy full SHA for dbcf0cb
src/cmd/go/testdata/script/build_issue413974.txt
@@ -0,0 +1,33 @@
1
+# Regression test for https://go.dev/issue/413974:
2
+# cgo build should reproduce binaries with LTO enable
3
+
4
+[!cgo] skip
5
+[short] skip 'links cgo binaries'
6
7
+env GOFLAGS=-ldflags=-linkmode=external
8
+env CGO_CFLAGS=-flto
9
10
+go build -o main.exe
11
+mv main.exe main1.exe
12
13
+env GOCACHE=$WORK${/}gocache
14
+mkdir $GOCACHE
15
16
+mv main.exe main2.exe
17
18
+cmp -q main2.exe main1.exe
19
20
+-- go.mod --
21
+module main
22
23
+go 1.18
24
+-- main.go --
25
+package main
26
27
+import "C"
28
29
+var _ C.int
30
31
+func main() {
32
+ println("Hello World")
33
+}
0 commit comments