]> Cypherpunks repositories - gostls13.git/commitdiff
test: make inline_callers.go test not inline the runtime
authorAustin Clements <austin@google.com>
Tue, 21 Nov 2017 22:55:18 +0000 (17:55 -0500)
committerAustin Clements <austin@google.com>
Wed, 22 Nov 2017 00:52:54 +0000 (00:52 +0000)
CL 76551 modified inline_callers.go to build everything, including the
runtime, with -l=4. While that works in most places (and ideally
should work everywhere), it blows out the nosplit stack on
solaris/amd64.

Fix this by only building the test itself with -l=4.

This undoes some of the changes to this test from CL 73212, which
originally changed the go tool to rebuild all packages with the given
flags. This change modified the expected output of this test, so now
that we can go back to building only the test itself with inlining, we
revert these changes to the expected output. (That CL also changed
log.Fatalf to log.Printf, but didn't add "\n" to the end of the lines,
so this CL fixes that, too.)

Fixes #22797.

Change-Id: I6a91963a59ebe98edbe0921d8717af6b2c2191b0
Reviewed-on: https://go-review.googlesource.com/79197
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
test/inline_callers.go

index 16012daec466b85bffaaefd5de5accf0f2274406..6df6861951281b3cf91c21610bb0f6f881f5ff6b 100644 (file)
@@ -1,4 +1,4 @@
-// run -gcflags=all=-l=4
+// run -gcflags=-l=4
 
 // Copyright 2017 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -56,8 +56,8 @@ func testCallersFrames(skp int) (frames []string) {
 }
 
 var expectedFrames [][]string = [][]string{
-       0: {"main.testCallers", "main.main"},
-       1: {"main.testCallers", "runtime.skipPleaseUseCallersFrames", "main.main"},
+       0: {"runtime.Callers", "main.testCallers", "main.main"},
+       1: {"main.testCallers", "main.main"},
        2: {"main.testCallers", "runtime.skipPleaseUseCallersFrames", "main.main"},
        3: {"main.testCallers", "runtime.skipPleaseUseCallersFrames", "main.main"},
        4: {"main.testCallers", "runtime.skipPleaseUseCallersFrames", "main.main"},
@@ -83,13 +83,13 @@ func main() {
                frames := testCallers(i)
                expected := expectedFrames[i]
                if !same(frames, expected) {
-                       fmt.Printf("testCallers(%d):\n got %v\n want %v", i, frames, expected)
+                       fmt.Printf("testCallers(%d):\n got %v\n want %v\n", i, frames, expected)
                }
 
                frames = testCallersFrames(i)
                expected = allFrames[i:]
                if !same(frames, expected) {
-                       fmt.Printf("testCallersFrames(%d):\n got %v\n want %v", i, frames, expected)
+                       fmt.Printf("testCallersFrames(%d):\n got %v\n want %v\n", i, frames, expected)
                }
        }
 }