aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/link_test.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2025-01-22 17:18:19 -0500
committerGopher Robot <gobot@golang.org>2025-05-19 11:00:01 -0700
commit2c929d6f4c8fcd1021dc3cd57b2eedff5ae9a592 (patch)
treebd5dc12ab00823fa1f4450eb838cf0eb4d2abfb8 /src/cmd/link/link_test.go
parent5afada035ced1f89267d3177a9fb75fab4df81ff (diff)
downloadgo-2c929d6f4c8fcd1021dc3cd57b2eedff5ae9a592.tar.xz
runtime: pass through -asan/-msan/-race to testprog tests
The tests using testprog / testprogcgo are currently not covered on the asan/msan/race builders because they don't build testprog with the sanitizer flag. Explicitly pass the flag if the test itself is built with the sanitizer. There were a few tests that explicitly passed -race (even on non-race builders). These tests will now only run on race builders. For #71395. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-asan-clang15,gotip-linux-amd64-msan-clang15,gotip-linux-amd64-race Change-Id: I6a6a636ce8271246316a80d426c0e4e2f6ab99c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/643897 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/cmd/link/link_test.go')
-rw-r--r--src/cmd/link/link_test.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go
index 53c4ee77fe..f26495a2b1 100644
--- a/src/cmd/link/link_test.go
+++ b/src/cmd/link/link_test.go
@@ -46,7 +46,9 @@ func TestIssue21703(t *testing.T) {
t.Parallel()
testenv.MustHaveGoBuild(t)
- testenv.MustInternalLink(t, false)
+ // N.B. the build below explictly doesn't pass through
+ // -asan/-msan/-race, so we don't care about those.
+ testenv.MustInternalLink(t, testenv.NoSpecialBuildTypes)
const source = `
package main
@@ -91,7 +93,9 @@ func TestIssue28429(t *testing.T) {
t.Parallel()
testenv.MustHaveGoBuild(t)
- testenv.MustInternalLink(t, false)
+ // N.B. go build below explictly doesn't pass through
+ // -asan/-msan/-race, so we don't care about those.
+ testenv.MustInternalLink(t, testenv.NoSpecialBuildTypes)
tmpdir := t.TempDir()
@@ -189,7 +193,9 @@ main.x: relocation target main.zero not defined
func TestIssue33979(t *testing.T) {
testenv.MustHaveGoBuild(t)
testenv.MustHaveCGO(t)
- testenv.MustInternalLink(t, true)
+ // N.B. go build below explictly doesn't pass through
+ // -asan/-msan/-race, so we don't care about those.
+ testenv.MustInternalLink(t, testenv.NoSpecialBuildTypes)
t.Parallel()
@@ -953,7 +959,9 @@ func TestIndexMismatch(t *testing.T) {
// This shouldn't happen with "go build". We invoke the compiler and the linker
// manually, and try to "trick" the linker with an inconsistent object file.
testenv.MustHaveGoBuild(t)
- testenv.MustInternalLink(t, false)
+ // N.B. the build below explictly doesn't pass through
+ // -asan/-msan/-race, so we don't care about those.
+ testenv.MustInternalLink(t, testenv.NoSpecialBuildTypes)
t.Parallel()