From d9ee4b2859172a84b17eec63d9368e8923896ee4 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Mon, 4 Nov 2019 16:19:29 -0500 Subject: [PATCH] cmd/link/internal/ld: fix TestArchiveBuildInvokeWithExec TestArchiveBuildInvokeWithExec is failing on darwin due to duplicated symbols, because the C definition (int fortytwo;) is copied to two generated cgo sources. In fact, this test is about building c-archive, but doesn't need to import "C". Removed the "C" import. Change-Id: I3a17546e01272a7ae37e6417791ab949fb44597e Reviewed-on: https://go-review.googlesource.com/c/go/+/205278 Run-TryBot: Cherry Zhang Reviewed-by: Than McIntosh --- src/cmd/link/internal/ld/ld_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/cmd/link/internal/ld/ld_test.go b/src/cmd/link/internal/ld/ld_test.go index 1ffcadece9..4dbe09d586 100644 --- a/src/cmd/link/internal/ld/ld_test.go +++ b/src/cmd/link/internal/ld/ld_test.go @@ -76,14 +76,9 @@ func TestUndefinedRelocErrors(t *testing.T) { const carchiveSrcText = ` package main -// int fortytwo; -import "C" - -var v int - //export GoFunc func GoFunc() { - v = int(C.fortytwo) + println(42) } func main() { -- 2.50.0