From e862f98d1e49eadac1b7f35a8c9d5c7610d37744 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 21 Nov 2017 17:55:18 -0500 Subject: [PATCH] test: make inline_callers.go test not inline the runtime 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- test/inline_callers.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/inline_callers.go b/test/inline_callers.go index 16012daec4..6df6861951 100644 --- a/test/inline_callers.go +++ b/test/inline_callers.go @@ -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) } } }