From a070533633bd709bc3598dbd7c28edca1d2ba6e2 Mon Sep 17 00:00:00 2001 From: "khr@golang.org" Date: Tue, 20 May 2025 15:59:02 -0700 Subject: [PATCH] reflect: turn off allocation test if instrumentation is on Help fix the asan builders. Change-Id: I980f5171519643c3543bdefc6ea46fd0fca17c28 Reviewed-on: https://go-review.googlesource.com/c/go/+/674616 Reviewed-by: Dmitri Shuralyov Reviewed-by: Keith Randall Auto-Submit: Keith Randall LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov --- src/reflect/all_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index e86ee9d322..fb1a29d060 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -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) -- 2.51.0