]> Cypherpunks repositories - gostls13.git/commitdiff
test: split non-regabi stack map test
authorMichael Pratt <mpratt@google.com>
Mon, 21 Oct 2024 16:58:22 +0000 (12:58 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 21 Oct 2024 20:54:57 +0000 (20:54 +0000)
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>
test/live.go
test/live_noswiss.go
test/live_swiss.go

index fb637526db5883f470124dd514be74c2dfcff971..703e9950afe0a88617976a626d3e59d9406ea211 100644 (file)
@@ -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()
index f9c78290c49b0c4e6dc2009a7eb88723c06322d6..8a96cb05fcb8176f130a42aede09f19468971a8e 100644 (file)
@@ -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)
+}
index 2c91435c47cd0025c8f5dc9f4b8f1020f9e54e61..fab15fc9f37c1ed00abd096ce8340d8bdcfc9e6c 100644 (file)
@@ -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)
+}