mirror of
https://github.com/golang/go
synced 2024-10-04 15:09:59 +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:
parent
507144c011
commit
04e76f295f
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue