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 3abc1b0Copy full SHA for 3abc1b0
src/cmd/go/testdata/script/build_issue413974.txt
@@ -0,0 +1,32 @@
1
+# Regression test for https://go.dev/issue/413974:
2
+# cgo build should reproduce binaries with LTO enable
3
+
4
+[!cgo] skip
5
6
+env GOFLAGS=-ldflags=-linkmode=external
7
+env CGO_CFLAGS=-flto
8
9
+go build -o main.exe
10
+mv main.exe main1.exe
11
12
+env GOCACHE=$WORK${/}gocache
13
+mkdir $GOCACHE
14
15
+mv main.exe main2.exe
16
17
+cmp -q main2.exe main1.exe
18
19
+-- go.mod --
20
+module main
21
22
+go 1.18
23
+-- main.go --
24
+package main
25
26
+import "C"
27
28
+var _ C.int
29
30
+func main() {
31
+ println("Hello World")
32
+}
0 commit comments