1
0
mirror of https://github.com/golang/go synced 2024-07-05 09:50:19 +00:00

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: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Cherry Zhang 2016-08-17 10:32:39 -04:00
parent 507144c011
commit 04e76f295f
2 changed files with 16 additions and 0 deletions

View File

@ -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"
}

View File

@ -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"
}