Test nil check removal for access of PAUTOHEAP.
Change-Id: Id739a9cda7cd3ff173bdcccfedcad93ee90711ef
Reviewed-on: https://go-review.googlesource.com/27232
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
        p := new([100]byte)
        return p[5] // ERROR "removed nil check"
 }
+
+// make sure not to do nil check for access of PAUTOHEAP
+//go:noinline
+func (p *Struct) m() {}
+func c1() {
+       var x Struct
+       func() { x.m() }() // ERROR "removed nil check"
+}
 
        p := new([100]byte)
        return p[5] // ERROR "removed nil check"
 }
+
+// make sure not to do nil check for access of PAUTOHEAP
+//go:noinline
+func (p *Struct) m() {}
+func c1() {
+       var x Struct
+       func() { x.m() }() // ERROR "removed nil check"
+}