]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/test: fix noopt builder
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 26 Feb 2025 14:04:04 +0000 (21:04 +0700)
committerGopher Robot <gobot@golang.org>
Wed, 26 Feb 2025 15:04:08 +0000 (07:04 -0800)
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 <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>

src/cmd/compile/internal/test/issue71943_test.go

index 23312b4ee11aa219ee22dfe2dbcad110fcaae1b3..a92b0a1e2b038da8fcbede71ac99b12a455df05d 100644 (file)
@@ -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 {