From: Than McIntosh Date: Mon, 14 Aug 2023 13:41:43 +0000 (-0400) Subject: runtime: test change to adapt to new inliner X-Git-Tag: go1.22rc1~918 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3997fb924376bf0262a8108c916132329700dbf0;p=gostls13.git runtime: test change to adapt to new inliner The new inliner tries to de-prioritize inlining of call sites on panic paths, e.g. for a call such as the one to "foo" below, the inliner will use a much lower size threshold when deciding whether to inline, since the path is very likely to be "cold". if mumble() { foo() <<-- here panic("bad") } This patch reworks one of the traceback tests is relying on the old inliner's "inline F everywhere if F inlinable" strategy by tweaking the code slightly (no change in test functionality). Change-Id: I83a686b0cc4d94a6cfc63d1e84e45455c1afd5b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/519196 LUCI-TryBot-Result: Go LUCI Reviewed-by: Austin Clements Reviewed-by: Matthew Dempsky --- diff --git a/src/runtime/traceback_test.go b/src/runtime/traceback_test.go index 1617612418..204b4f5316 100644 --- a/src/runtime/traceback_test.go +++ b/src/runtime/traceback_test.go @@ -108,7 +108,13 @@ func ttiSigpanic1() (res *ttiResult) { recover() }() ttiSigpanic2() - panic("did not panic") + // without condition below the inliner might decide to de-prioritize + // the callsite above (since it would be on an "always leads to panic" + // path). + if alwaysTrue { + panic("did not panic") + } + return nil } func ttiSigpanic2() { ttiSigpanic3() @@ -118,6 +124,8 @@ func ttiSigpanic3() { *p = 3 } +var alwaysTrue = true + //go:noinline func ttiWrapper1() *ttiResult { var w ttiWrapper