summaryrefslogtreecommitdiff
path: root/test/escape_param.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-12-10 20:55:10 -0500
committerRuss Cox <rsc@golang.org>2020-12-17 03:50:03 +0000
commit4dfc7333f4ebe67e0aa7f429ce73c9d58a2fc309 (patch)
treed3c76b40649a9f0c4cb865c0e75da2843e42750a /test/escape_param.go
parenta997543292df533f5951cd8fda39692a44077151 (diff)
downloadgo-git-4dfc7333f4ebe67e0aa7f429ce73c9d58a2fc309.tar.gz
[dev.regabi] cmd/compile: update ir/fmt for concrete types
An automated rewrite will add concrete type assertions after a test of n.Op(), when n can be safely type-asserted (meaning, n is not reassigned a different type, n is not reassigned and then used outside the scope of the type assertion, and so on). This sequence of CLs handles the code that the automated rewrite does not: adding specific types to function arguments, adjusting code not to call n.Left() etc when n may have multiple representations, and so on. This CL handles package fmt. There are various type assertions but also some rewriting to lean more heavily on reflection. Passes buildall w/ toolstash -cmp. Change-Id: I503467468b42ace11bff2ba014b03cfa345e6d03 Reviewed-on: https://go-review.googlesource.com/c/go/+/277915 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/escape_param.go')
-rw-r--r--test/escape_param.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/escape_param.go b/test/escape_param.go
index 993e914e1d..dc93f689cf 100644
--- a/test/escape_param.go
+++ b/test/escape_param.go
@@ -212,7 +212,7 @@ func caller7() {
// **in -> heap
func param8(i **int) { // ERROR "i does not escape$"
- sink = **i // ERROR "\* \(\*i\) escapes to heap"
+ sink = **i // ERROR "\*\(\*i\) escapes to heap"
}
func caller8() {
@@ -402,7 +402,7 @@ func caller13h() {
var p *int
v := &Val{&p} // ERROR "&Val{...} does not escape$"
v.param13(&i)
- sink = **v.p // ERROR "\* \(\*v\.p\) escapes to heap"
+ sink = **v.p // ERROR "\*\(\*v\.p\) escapes to heap"
}
type Node struct {