aboutsummaryrefslogtreecommitdiff
path: root/test/escape5.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2019-08-30 10:56:30 -0700
committerMatthew Dempsky <mdempsky@google.com>2019-09-03 17:52:06 +0000
commit9f89edcd9668bb3b011961fbcdd8fc2796acba5d (patch)
treefac2ea3d67038eff5b913af5cb6b24224c94767f /test/escape5.go
parenta71967e4c5aa34f274b8b9aff915f14ac00e7ee8 (diff)
downloadgo-9f89edcd9668bb3b011961fbcdd8fc2796acba5d.tar.gz
go-9f89edcd9668bb3b011961fbcdd8fc2796acba5d.zip
cmd/compile: silence esc diagnostics about directiface OCONVIFACEs
In general, a conversion to interface type may require values to be boxed, which in turn necessitates escape analysis to determine whether the boxed representation can be stack allocated. However, esc.go used to unconditionally print escape analysis decisions about OCONVIFACE, even for conversions that don't require boxing (e.g., pointers, channels, maps, functions). For test compatibility with esc.go, escape.go similarly printed these useless diagnostics. This CL removes the diagnostics, and updates test expectations accordingly. Change-Id: I97c57a4a08e44d265bba516c78426ff4f2bf1e12 Reviewed-on: https://go-review.googlesource.com/c/go/+/192697 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'test/escape5.go')
-rw-r--r--test/escape5.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/escape5.go b/test/escape5.go
index cbbccb4109..061e57a069 100644
--- a/test/escape5.go
+++ b/test/escape5.go
@@ -139,7 +139,7 @@ func f8(p *T1) (k T2) { // ERROR "leaking param: p$"
}
// should make p leak always
- global = p // ERROR "p escapes to heap"
+ global = p
return T2{p}
}
@@ -164,7 +164,7 @@ func f13() {
var x *int
f11(&x)
f12(&x)
- runtime.KeepAlive(&x) // ERROR "&x does not escape"
+ runtime.KeepAlive(&x)
}
// Test for issue 24305 (passing to unnamed receivers does not escape).