Skip to content

Commit 6f42b61

Browse files
committedMay 3, 2015
test: fix nosplit test for noopt build
Noopt builds get a larger stack guard. This test must take that into account. Change-Id: I1b5cbafdbbfee8c369ae1bebd0b900524ebf0d7d Reviewed-on: https://go-review.googlesource.com/9610 Reviewed-by: Russ Cox <[email protected]>
1 parent e8057df commit 6f42b61

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎test/nosplit.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,16 @@ TestCases:
292292

293293
// The limit was originally 128 but is now 512.
294294
// Instead of rewriting the test cases above, adjust
295-
// the first stack frame to use up the extra 32 bytes.
295+
// the first stack frame to use up the extra bytes.
296296
if i == 0 {
297297
size += 512 - 128
298+
// Noopt builds have a larger stackguard.
299+
// See ../cmd/dist/buildruntime.go:stackGuardMultiplier
300+
for _, s := range strings.Split(os.Getenv("GO_GCFLAGS"), " ") {
301+
if s == "-N" {
302+
size += 640
303+
}
304+
}
298305
}
299306

300307
if size%ptrSize == 4 {

0 commit comments

Comments
 (0)
Please sign in to comment.