Debian Codegraph @

gcc/testsuite/go.test/test/fixedbugs/issue10607.go

raw
1 // +build linux,!ppc64,!riscv64,gc
2 // run
3
4 // Copyright 2015 The Go Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style
6 // license that can be found in the LICENSE file.
7
8 // Test that a -B option is passed through when using both internal
9 // and external linking mode.
10
11 // TODO(jsing): Re-enable on riscv64 when it has support for external
12 // linking - see golang.org/issue/36739
13
14 package main
15
16 import (
17 "fmt"
18 "os"
19 "os/exec"
20 "path/filepath"
21 )
22
23 func main() {
24 test("internal")
25 test("external")
26 }
27
28 func test(linkmode string) {
29 out, err := exec.Command("go", "run", "-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput()
30 if err != nil {
31 fmt.Printf("BUG: linkmode=%s %v\n%s\n", linkmode, err, out)
32 os.Exit(1)
33 }
34 }