aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/link_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/link/link_test.go')
-rw-r--r--src/cmd/link/link_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go
index 4eb02c9e8a..7eeb7ef568 100644
--- a/src/cmd/link/link_test.go
+++ b/src/cmd/link/link_test.go
@@ -786,6 +786,25 @@ func TestPErsrc(t *testing.T) {
if !bytes.Contains(b, []byte("Hello Gophers!")) {
t.Fatalf("binary does not contain expected content")
}
+
+ pkgdir = filepath.Join("testdata", "testPErsrc-complex")
+ exe = filepath.Join(tmpdir, "a.exe")
+ cmd = exec.Command(testenv.GoToolPath(t), "build", "-o", exe)
+ cmd.Dir = pkgdir
+ // cmd.Env = append(os.Environ(), "GOOS=windows", "GOARCH=amd64") // uncomment if debugging in a cross-compiling environment
+ out, err = cmd.CombinedOutput()
+ if err != nil {
+ t.Fatalf("building failed: %v, output:\n%s", err, out)
+ }
+
+ // Check that the binary contains the rsrc data
+ b, err = ioutil.ReadFile(exe)
+ if err != nil {
+ t.Fatalf("reading output failed: %v", err)
+ }
+ if !bytes.Contains(b, []byte("resname RCDATA a.rc")) {
+ t.Fatalf("binary does not contain expected content")
+ }
}
func TestContentAddressableSymbols(t *testing.T) {