cmd/compile: don't instrument counter globals in internal/fuzz

Fixes: #72766

Change-Id: I45b521e53c2a11e259dc99e2dfc8e40cac39139a
Reviewed-on: https://go-review.googlesource.com/c/go/+/673575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Mateusz Poliwczak 2025-05-16 21:07:46 +02:00 committed by Gopher Robot
parent 123141166b
commit 3e82316a43
3 changed files with 10 additions and 1 deletions

View file

@ -135,6 +135,9 @@ func TestASANFuzz(t *testing.T) {
if bytes.Contains(out, []byte("AddressSanitizer")) {
t.Error(`output contains "AddressSanitizer", but should not`)
}
if !bytes.Contains(out, []byte("FUZZ FAILED")) {
t.Error(`fuzz test did not fail with a "FUZZ FAILED" sentinel error`)
}
}
func mustHaveASAN(t *testing.T) *config {

View file

@ -24,7 +24,7 @@ func FuzzReverse(f *testing.F) {
r1 := Reverse(s)
r2 := Reverse(r1)
if s != r2 {
t.Errorf("got %q want %q", r2, s)
t.Errorf("FUZZ FAILED: got %q want %q", r2, s)
}
})
}