diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/fixedbugs/issue69110.go | 2 | ||||
| -rw-r--r-- | test/live.go | 4 | ||||
| -rw-r--r-- | test/live2.go | 4 | ||||
| -rw-r--r-- | test/live_regabi.go | 12 | ||||
| -rw-r--r-- | test/live_regabi_noswiss.go | 19 | ||||
| -rw-r--r-- | test/live_regabi_swiss.go | 19 |
6 files changed, 45 insertions, 15 deletions
diff --git a/test/fixedbugs/issue69110.go b/test/fixedbugs/issue69110.go index 71a4bcac31..ab51d0b5a6 100644 --- a/test/fixedbugs/issue69110.go +++ b/test/fixedbugs/issue69110.go @@ -1,5 +1,7 @@ // run +//go:build !goexperiment.swissmap + // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/test/live.go b/test/live.go index 8e4fdc7f46..bb67af0cd0 100644 --- a/test/live.go +++ b/test/live.go @@ -438,7 +438,7 @@ func f28(b bool) { func f29(b bool) { if b { - for k := range m { // ERROR "live at call to mapiterinit: .autotmp_[0-9]+$" "live at call to mapiternext: .autotmp_[0-9]+$" "stack object .autotmp_[0-9]+ runtime.hiter$" + for k := range m { // ERROR "live at call to mapiterinit: .autotmp_[0-9]+$" "live at call to mapiternext: .autotmp_[0-9]+$" "stack object .autotmp_[0-9]+ (runtime.hiter|internal/runtime/maps.Iter)$" printstring(k) // ERROR "live at call to printstring: .autotmp_[0-9]+$" } } @@ -647,7 +647,7 @@ func bad40() { 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$" + 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.table)$" t := &ret printnl() // ERROR "live at call to printnl: ret$" // Note: ret is live at the printnl because the compiler moves &ret diff --git a/test/live2.go b/test/live2.go index 2beac4f8d2..7b66b6c5a8 100644 --- a/test/live2.go +++ b/test/live2.go @@ -27,14 +27,14 @@ func newT40() *T40 { } func bad40() { - t := newT40() // ERROR "stack object ret T40$" "stack object .autotmp_[0-9]+ runtime.hmap$" + t := newT40() // ERROR "stack object ret T40$" "stack object .autotmp_[0-9]+ (runtime.hmap|internal/runtime/maps.table)$" printnl() // ERROR "live at call to printnl: ret$" useT40(t) } func good40() { ret := T40{} // ERROR "stack object ret T40$" - ret.m = make(map[int]int, 42) // ERROR "stack object .autotmp_[0-9]+ runtime.hmap$" + ret.m = make(map[int]int, 42) // ERROR "stack object .autotmp_[0-9]+ (runtime.hmap|internal/runtime/maps.table)$" t := &ret printnl() // ERROR "live at call to printnl: ret$" useT40(t) diff --git a/test/live_regabi.go b/test/live_regabi.go index 3bd7158ffe..28b4077493 100644 --- a/test/live_regabi.go +++ b/test/live_regabi.go @@ -434,7 +434,7 @@ func f28(b bool) { func f29(b bool) { if b { - for k := range m { // ERROR "live at call to mapiterinit: .autotmp_[0-9]+$" "live at call to mapiternext: .autotmp_[0-9]+$" "stack object .autotmp_[0-9]+ runtime.hiter$" + for k := range m { // ERROR "live at call to mapiterinit: .autotmp_[0-9]+$" "live at call to mapiternext: .autotmp_[0-9]+$" "stack object .autotmp_[0-9]+ (runtime.hiter|internal/runtime/maps.Iter)$" printstring(k) // ERROR "live at call to printstring: .autotmp_[0-9]+$" } } @@ -641,16 +641,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$" - 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() diff --git a/test/live_regabi_noswiss.go b/test/live_regabi_noswiss.go index 636d4e5a0c..43881c3b61 100644 --- a/test/live_regabi_noswiss.go +++ b/test/live_regabi_noswiss.go @@ -36,3 +36,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) +} diff --git a/test/live_regabi_swiss.go b/test/live_regabi_swiss.go index d35b8aadfe..e00a71409f 100644 --- a/test/live_regabi_swiss.go +++ b/test/live_regabi_swiss.go @@ -38,3 +38,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.table$" + 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) +} |
