]> Cypherpunks repositories - gostls13.git/commitdiff
test: fix nosplit test for noopt build
authorKeith Randall <khr@golang.org>
Fri, 1 May 2015 16:36:18 +0000 (09:36 -0700)
committerKeith Randall <khr@golang.org>
Sun, 3 May 2015 16:10:40 +0000 (16:10 +0000)
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 <rsc@golang.org>
test/nosplit.go

index bd4e60bc1345ac70972c3468b3dfe7a3f3d919b0..bd7a8ddac39c755c0469fc34e1f3b5419a15d7ed 100644 (file)
@@ -292,9 +292,16 @@ TestCases:
 
                                // The limit was originally 128 but is now 512.
                                // Instead of rewriting the test cases above, adjust
-                               // the first stack frame to use up the extra 32 bytes.
+                               // the first stack frame to use up the extra bytes.
                                if i == 0 {
                                        size += 512 - 128
+                                       // Noopt builds have a larger stackguard.
+                                       // See ../cmd/dist/buildruntime.go:stackGuardMultiplier
+                                       for _, s := range strings.Split(os.Getenv("GO_GCFLAGS"), " ") {
+                                               if s == "-N" {
+                                                       size += 640
+                                               }
+                                       }
                                }
 
                                if size%ptrSize == 4 {