]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: add failing test case for #24305
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 12 Aug 2020 16:12:57 +0000 (23:12 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 15 Aug 2020 03:09:52 +0000 (03:09 +0000)
Updates #24305

Change-Id: Ib0b093e33004a978467cdd1e77186798392d4eca
Reviewed-on: https://go-review.googlesource.com/c/go/+/248217
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
test/escape5.go

index 061e57a0691140bad6adc1a53854e3e8a21b3cb2..2ed2023cd26e72ad3db20eeebf28a6deaae3a363 100644 (file)
@@ -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