From 769be04feb724e03c1f2b757fc19326a1486896c Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 4 Feb 2017 17:33:14 +1100 Subject: [PATCH] cmd/nm: skip TestInternalLinkerCgoFile if no internal linking is supported Fixes build. Change-Id: I2fee624c8a4b228bb9f2889e241ea016a317bb11 Reviewed-on: https://go-review.googlesource.com/36373 TryBot-Result: Gobot Gobot Reviewed-by: Alex Brainman --- src/cmd/nm/nm_cgo_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/cmd/nm/nm_cgo_test.go b/src/cmd/nm/nm_cgo_test.go index 633f9c0406..de16f77ecc 100644 --- a/src/cmd/nm/nm_cgo_test.go +++ b/src/cmd/nm/nm_cgo_test.go @@ -7,13 +7,30 @@ package main import ( + "runtime" "testing" ) func TestInternalLinkerCgoFile(t *testing.T) { + if !canInternalLink() { + t.Skip("skipping; internal linking is not supported") + } testGoFile(t, true, false) } +func canInternalLink() bool { + switch runtime.GOOS { + case "dragonfly": + return false + case "linux": + switch runtime.GOARCH { + case "arm64", "mips64", "mips64le", "mips", "mipsle": + return false + } + } + return true +} + func TestExternalLinkerCgoFile(t *testing.T) { testGoFile(t, true, true) }