Skip to content

Commit 5c98bcb

Browse files
committed
runtime: fix noopt builder
CL 352057 added track argument stack slot liveness, and updated TestTracebackArgs for argument liveness. But when optimization is disabled, all arguments are considered lived. The abiSel does not consider this case and return wrong expected result. To fix this, checking if we are running in a noopt builder and return the correct expected result. Also, skipping TestTracebackArgs in quick mode, since when quick mode run the test without optimization disable. Updates #45728 Change-Id: I3737a1b1a5fa0c711fbb3218205f2f6e34f36260 Reviewed-on: https://go-review.googlesource.com/c/go/+/359196 Trust: Cuong Manh Le <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent a3bb28e commit 5c98bcb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/runtime/traceback_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ package runtime_test
77
import (
88
"bytes"
99
"internal/goexperiment"
10+
"internal/testenv"
1011
"runtime"
12+
"strings"
1113
"testing"
1214
)
1315

1416
var testTracebackArgsBuf [1000]byte
1517

1618
func TestTracebackArgs(t *testing.T) {
17-
abiSel := func(x, y string) string { // select expected output based on ABI
18-
if goexperiment.RegabiArgs {
19+
if *flagQuick {
20+
t.Skip("-quick")
21+
}
22+
optimized := !strings.HasSuffix(testenv.Builder(), "-noopt")
23+
abiSel := func(x, y string) string {
24+
// select expected output based on ABI
25+
// In noopt build we always spill arguments so the output is the same as stack ABI.
26+
if optimized && goexperiment.RegabiArgs {
1927
return x
2028
}
2129
return y

0 commit comments

Comments
 (0)