1
0
mirror of https://github.com/golang/go synced 2024-07-08 20:29:48 +00:00

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 <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Austin Clements 2017-11-21 17:55:18 -05:00
parent 1e3f563b14
commit e862f98d1e

View 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)
}
}
}