Commit 04e76f29 authored by Cherry Zhang's avatar Cherry Zhang

test: add test for CL 26831

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 507144c0
......@@ -214,3 +214,11 @@ func p1() byte {
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"
}
......@@ -226,3 +226,11 @@ func p1() byte {
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"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment