mirror of
https://github.com/golang/go
synced 2024-11-26 09:48:14 -07:00
test: enable inlining tests for functions with local type
Updates #57410 Change-Id: Ibe1f5523a4635d2b844b9a5db94514e07eb0bc0f Reviewed-on: https://go-review.googlesource.com/c/go/+/463998 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
3e1478ef0d
commit
ac7efcb0ca
@ -38,11 +38,7 @@ func f2() {} // ERROR "can inline f2"
|
||||
func f3() { panic(1) } // ERROR "can inline f3" "1 escapes to heap"
|
||||
func f4() { recover() }
|
||||
|
||||
// TODO(cuonglm): remove f5, f6 //go:noinline and update the error message
|
||||
// once GOEXPERIMENT=nounified is gone.
|
||||
|
||||
//go:noinline
|
||||
func f5() *byte {
|
||||
func f5() *byte { // ERROR "can inline f5"
|
||||
type T struct {
|
||||
x [1]byte
|
||||
}
|
||||
@ -50,8 +46,7 @@ func f5() *byte {
|
||||
return &t.x[0]
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func f6() *byte {
|
||||
func f6() *byte { // ERROR "can inline f6"
|
||||
type T struct {
|
||||
x struct {
|
||||
y byte
|
||||
|
Loading…
Reference in New Issue
Block a user