]> Cypherpunks.ru repositories - gostls13.git/blob - test/fixedbugs/issue10607.go
cmd/internal/testdir: parse past gofmt'd //go:build lines
[gostls13.git] / test / fixedbugs / issue10607.go
1 //go:build linux && !ppc64 && gc && cgo
2 // +build linux,!ppc64,gc,cgo
3
4 // run
5
6 // Copyright 2015 The Go Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style
8 // license that can be found in the LICENSE file.
9
10 // Test that a -B option is passed through when using both internal
11 // and external linking mode.
12
13 package main
14
15 import (
16         "fmt"
17         "os"
18         "os/exec"
19         "path/filepath"
20 )
21
22 func main() {
23         test("internal")
24         test("external") // The 'cgo' build constraint should imply that a linker is available.
25 }
26
27 func test(linkmode string) {
28         out, err := exec.Command("go", "run", "-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput()
29         if err != nil {
30                 fmt.Printf("BUG: linkmode=%s %v\n%s\n", linkmode, err, out)
31                 os.Exit(1)
32         }
33 }