From: Cuong Manh Le Date: Wed, 12 Aug 2020 16:12:57 +0000 (+0700) Subject: cmd/compile: add failing test case for #24305 X-Git-Tag: go1.16beta1~1353 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=948d324f7d8641a042da46c25417ebabd84e5e78;p=gostls13.git cmd/compile: add failing test case for #24305 Updates #24305 Change-Id: Ib0b093e33004a978467cdd1e77186798392d4eca Reviewed-on: https://go-review.googlesource.com/c/go/+/248217 Run-TryBot: Cuong Manh Le TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- diff --git a/test/escape5.go b/test/escape5.go index 061e57a069..2ed2023cd2 100644 --- a/test/escape5.go +++ b/test/escape5.go @@ -179,6 +179,13 @@ func _() { u.N() } +func fbad24305() { + // BAD u should not be heap allocated + var u U // ERROR "moved to heap: u" + (*U).M(&u) + (*U).N(&u) +} + // Issue 24730: taking address in a loop causes unnecessary escape type T24730 struct { x [64]byte