runtime: disable stack allocation test when instrumentation is on

Should fix some asan build failures.

Change-Id: Ic0a816b56a1a278aa0ad541aea962f9fea7b10fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/674696
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
khr@golang.org 2025-05-20 15:56:29 -07:00 committed by Keith Randall
parent fccac5fe98
commit 4cdca1342b
1 changed files with 7 additions and 1 deletions

View File

@ -7,7 +7,10 @@ package runtime_test
import (
"flag"
"fmt"
"internal/asan"
"internal/cpu"
"internal/msan"
"internal/race"
"internal/runtime/atomic"
"internal/testenv"
"io"
@ -329,6 +332,9 @@ func TestAppendGrowthHeap(t *testing.T) {
}
func TestAppendGrowthStack(t *testing.T) {
if race.Enabled || asan.Enabled || msan.Enabled {
t.Skip("instrumentation breaks this optimization")
}
var x []int64
check := func(want int) {
if cap(x) != want {
@ -338,7 +344,7 @@ func TestAppendGrowthStack(t *testing.T) {
check(0)
want := 32 / 8 // 32 is the default for cmd/compile/internal/base.DebugFlags.VariableMakeThreshold
if Raceenabled || testenv.OptimizationOff() {
if testenv.OptimizationOff() {
want = 1
}
for i := 1; i <= 100; i++ {