mirror of https://github.com/golang/go.git
test: split non-regabi stack map test
CL 594596 already did this for regabi, but missed non-regabi. Stack allocated swiss maps don't call rand32. For #54766. Change-Id: I312ea77532ecc6fa860adfea58ea00b01683ca69 Reviewed-on: https://go-review.googlesource.com/c/go/+/621615 Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
205ab8a3fe
commit
8668d7bbb9
10
test/live.go
10
test/live.go
|
|
@ -645,16 +645,6 @@ func bad40() {
|
|||
printnl()
|
||||
}
|
||||
|
||||
func good40() {
|
||||
ret := T40{} // ERROR "stack object ret T40$"
|
||||
ret.m = make(map[int]int) // ERROR "live at call to rand32: .autotmp_[0-9]+$" "stack object .autotmp_[0-9]+ (runtime.hmap|internal/runtime/maps.Map)$"
|
||||
t := &ret
|
||||
printnl() // ERROR "live at call to printnl: ret$"
|
||||
// Note: ret is live at the printnl because the compiler moves &ret
|
||||
// from before the printnl to after.
|
||||
useT40(t)
|
||||
}
|
||||
|
||||
func ddd1(x, y *int) { // ERROR "live at entry to ddd1: x y$"
|
||||
ddd2(x, y) // ERROR "stack object .autotmp_[0-9]+ \[2\]\*int$"
|
||||
printnl()
|
||||
|
|
|
|||
|
|
@ -40,3 +40,22 @@ func f17c() {
|
|||
}
|
||||
|
||||
func f17d() *byte
|
||||
|
||||
func printnl()
|
||||
|
||||
type T40 struct {
|
||||
m map[int]int
|
||||
}
|
||||
|
||||
//go:noescape
|
||||
func useT40(*T40)
|
||||
|
||||
func good40() {
|
||||
ret := T40{} // ERROR "stack object ret T40$"
|
||||
ret.m = make(map[int]int) // ERROR "live at call to rand32: .autotmp_[0-9]+$" "stack object .autotmp_[0-9]+ runtime.hmap$"
|
||||
t := &ret
|
||||
printnl() // ERROR "live at call to printnl: ret$"
|
||||
// Note: ret is live at the printnl because the compiler moves &ret
|
||||
// from before the printnl to after.
|
||||
useT40(t)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,3 +42,22 @@ func f17c() {
|
|||
}
|
||||
|
||||
func f17d() *byte
|
||||
|
||||
func printnl()
|
||||
|
||||
type T40 struct {
|
||||
m map[int]int
|
||||
}
|
||||
|
||||
//go:noescape
|
||||
func useT40(*T40)
|
||||
|
||||
func good40() {
|
||||
ret := T40{} // ERROR "stack object ret T40$"
|
||||
ret.m = make(map[int]int) // ERROR "stack object .autotmp_[0-9]+ internal/runtime/maps.Map$"
|
||||
t := &ret
|
||||
printnl() // ERROR "live at call to printnl: ret$"
|
||||
// Note: ret is live at the printnl because the compiler moves &ret
|
||||
// from before the printnl to after.
|
||||
useT40(t)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue