From 011da163f475b38ad70c9c652df6dc8dc2ba5168 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Wed, 26 Feb 2025 21:04:04 +0700 Subject: [PATCH] cmd/compile/internal/test: fix noopt builder The function argument passed to hash function escaped to heap when optimization is disabled, causing the builder failed. To fix this, skip the test on noopt builder. Updates #71943 Fixes #71965 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-noopt Change-Id: I3a9ece09bfa10bf5eb102a7da3ade65634565cb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/652735 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Auto-Submit: Cuong Manh Le --- src/cmd/compile/internal/test/issue71943_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/compile/internal/test/issue71943_test.go b/src/cmd/compile/internal/test/issue71943_test.go index 23312b4ee1..a92b0a1e2b 100644 --- a/src/cmd/compile/internal/test/issue71943_test.go +++ b/src/cmd/compile/internal/test/issue71943_test.go @@ -6,6 +6,7 @@ package test import ( "crypto/sha256" + "internal/testenv" "runtime" "testing" ) @@ -15,6 +16,7 @@ func Verify(token, salt string) [32]byte { } func TestIssue71943(t *testing.T) { + testenv.SkipIfOptimizationOff(t) if n := testing.AllocsPerRun(10, func() { runtime.KeepAlive(Verify("teststring", "test")) }); n > 0 { -- 2.50.0