]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: turn off allocation test if instrumentation is on
authorkhr@golang.org <khr@golang.org>
Tue, 20 May 2025 22:59:02 +0000 (15:59 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 00:27:54 +0000 (17:27 -0700)
Help fix the asan builders.

Change-Id: I980f5171519643c3543bdefc6ea46fd0fca17c28
Reviewed-on: https://go-review.googlesource.com/c/go/+/674616
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/reflect/all_test.go

index e86ee9d322f6399b2f7c4fbed6cf3ee12b9930c6..fb1a29d0605ffe3fa22e246b23e178035d550eb3 100644 (file)
@@ -13,6 +13,8 @@ import (
        "internal/asan"
        "internal/goarch"
        "internal/goexperiment"
+       "internal/msan"
+       "internal/race"
        "internal/testenv"
        "io"
        "math"
@@ -8766,6 +8768,9 @@ func TestTypeAssertPanic(t *testing.T) {
 }
 
 func TestTypeAssertAllocs(t *testing.T) {
+       if race.Enabled || asan.Enabled || msan.Enabled {
+               t.Skip("instrumentation breaks this optimization")
+       }
        typeAssertAllocs[[128]int](t, ValueOf([128]int{}), 0)
        typeAssertAllocs[any](t, ValueOf([128]int{}), 0)