]> Cypherpunks repositories - gostls13.git/commitdiff
test: fix tests to work with sizespecializedmalloc turned off
authormatloob@golang.org <matloob@golang.org>
Thu, 13 Nov 2025 22:04:54 +0000 (17:04 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 14 Nov 2025 00:57:31 +0000 (16:57 -0800)
Cq-Include-Trybots: luci.golang.try:gotip-linux-386-nosizespecializedmalloc,gotip-linux-amd64-nosizespecializedmalloc,gotip-linux-arm64-nosizespecializedmalloc
Change-Id: I6a6a696465004b939c989afc058c4c3e1fb7134f
Reviewed-on: https://go-review.googlesource.com/c/go/+/720401
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
test/codegen/strings.go
test/fixedbugs/issue15747.go
test/live.go
test/live_regabi.go
test/uintptrescapes2.go

index 9d85604395bf329b005ad5a6a1ad24607cf1f7f9..0c5ee2f8f5ed3fd06770bf178ba6955564fab7b9 100644 (file)
@@ -23,7 +23,7 @@ func CountBytes(s []byte) int {
 
 func ToByteSlice() []byte { // Issue #24698
        // amd64:`LEAQ type:\[3\]uint8`
-       // amd64:`CALL runtime\.mallocTiny3`
+       // amd64:`CALL runtime\.(newobject|mallocTiny3)`
        // amd64:-`.*runtime.stringtoslicebyte`
        return []byte("foo")
 }
index 743adb6a8ffb1fe1fcde5eead8a0d169fc4d1842..949a7f7944b2df5c179fcfbc843b5a64219b1de7 100644 (file)
@@ -19,7 +19,7 @@ type T struct{ M string }
 
 var b bool
 
-func f1(q *Q, xx []byte) interface{} { // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: xx$" "live at entry to f1: xx$"
+func f1(q *Q, xx []byte) interface{} { // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): xx$" "live at entry to f1: xx$"
        // xx was copied from the stack to the heap on the previous line:
        // xx was live for the first two prints but then it switched to &xx
        // being live. We should not see plain xx again.
@@ -36,7 +36,7 @@ func f1(q *Q, xx []byte) interface{} { // ERROR "live at call to mallocgcSmallSc
 //go:noinline
 func f2(d []byte, n int) (odata, res []byte, e interface{}) { // ERROR "live at entry to f2: d$"
        if n > len(d) {
-               return d, nil, &T{M: "hello"} // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: d"
+               return d, nil, &T{M: "hello"} // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+)+: d"
        }
        res = d[:n]
        odata = d[n:]
index 56b78ccf8b4af246c38d32c5f888480ffadc13d7..f8ad8df1ca0750d2ca1f7b058349174dd85f80fc 100644 (file)
@@ -467,9 +467,9 @@ func f27defer(b bool) {
 func f27go(b bool) {
        x := 0
        if b {
-               go call27(func() { x++ }) // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: &x$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: &x .autotmp_[0-9]+$" "live at call to newproc: &x$" // allocate two closures, the func literal, and the wrapper for go
+               go call27(func() { x++ }) // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): &x$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): &x .autotmp_[0-9]+$" "live at call to newproc: &x$" // allocate two closures, the func literal, and the wrapper for go
        }
-       go call27(func() { x++ }) // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: &x$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: .autotmp_[0-9]+$" // allocate two closures, the func literal, and the wrapper for go
+       go call27(func() { x++ }) // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): &x$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): .autotmp_[0-9]+$" // allocate two closures, the func literal, and the wrapper for go
        printnl()
 }
 
@@ -538,7 +538,7 @@ func f31(b1, b2, b3 bool) {
                g31(g18()) // ERROR "stack object .autotmp_[0-9]+ \[2\]string$"
        }
        if b2 {
-               h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: .autotmp_[0-9]+$"
+               h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): .autotmp_[0-9]+$"
        }
        if b3 {
                panic(g18())
@@ -665,14 +665,14 @@ func f39a() (x []int) {
 
 func f39b() (x [10]*int) {
        x = [10]*int{}
-       x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
+       x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
        printnl()       // ERROR "live at call to printnl: x$"
        return x
 }
 
 func f39c() (x [10]*int) {
        x = [10]*int{}
-       x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
+       x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
        printnl()       // ERROR "live at call to printnl: x$"
        return
 }
index 838cbdefad7c5bd29c31fb9d9e7e51e2191cf27e..9809353f1bf4eedfb78b973867a31fe6d0734301 100644 (file)
@@ -465,9 +465,9 @@ func f27defer(b bool) {
 func f27go(b bool) {
        x := 0
        if b {
-               go call27(func() { x++ }) // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: &x$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: &x .autotmp_[0-9]+$" "live at call to newproc: &x$" // allocate two closures, the func literal, and the wrapper for go
+               go call27(func() { x++ }) // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): &x$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): &x .autotmp_[0-9]+$" "live at call to newproc: &x$" // allocate two closures, the func literal, and the wrapper for go
        }
-       go call27(func() { x++ }) // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: &x$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: .autotmp_[0-9]+$" // allocate two closures, the func literal, and the wrapper for go
+       go call27(func() { x++ }) // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): &x$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): .autotmp_[0-9]+$" // allocate two closures, the func literal, and the wrapper for go
        printnl()
 }
 
@@ -536,7 +536,7 @@ func f31(b1, b2, b3 bool) {
                g31(g18()) // ERROR "stack object .autotmp_[0-9]+ \[2\]string$"
        }
        if b2 {
-               h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: .autotmp_[0-9]+$"
+               h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): .autotmp_[0-9]+$"
        }
        if b3 {
                panic(g18())
@@ -663,14 +663,14 @@ func f39a() (x []int) {
 
 func f39b() (x [10]*int) {
        x = [10]*int{}
-       x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
+       x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
        printnl()       // ERROR "live at call to printnl: x$"
        return x
 }
 
 func f39c() (x [10]*int) {
        x = [10]*int{}
-       x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
+       x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
        printnl()       // ERROR "live at call to printnl: x$"
        return
 }
index e111d47fab95c4cf04a9af2111b68cd9e2195608..b0f4665ebc71f4ba91cd46835d7304c774cfeb25 100644 (file)
@@ -50,16 +50,16 @@ func TestM1() {
 
 func TestF2() {
        var v int                                // ERROR "moved to heap"
-       F2(0, 1, uintptr(unsafe.Pointer(&v)), 2) // ERROR "live at call to mallocgcSmallNoScanSC[0-9]+: .?autotmp" "live at call to F2: .?autotmp" "escapes to heap" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
+       F2(0, 1, uintptr(unsafe.Pointer(&v)), 2) // ERROR "live at call to (newobject|mallocgcSmallNoScanSC[0-9]+): .?autotmp" "live at call to F2: .?autotmp" "escapes to heap" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
 }
 
 func TestF4() {
        var v2 int                                // ERROR "moved to heap"
-       F4(0, 1, uintptr(unsafe.Pointer(&v2)), 2) // ERROR "live at call to mallocgcSmallNoScanSC[0-9]+: .?autotmp" "live at call to F4: .?autotmp" "escapes to heap" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
+       F4(0, 1, uintptr(unsafe.Pointer(&v2)), 2) // ERROR "live at call to (newobject|mallocgcSmallNoScanSC[0-9]+): .?autotmp" "live at call to F4: .?autotmp" "escapes to heap" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
 }
 
 func TestM2() {
        var t T
        var v int                                  // ERROR "moved to heap"
-       t.M2(0, 1, uintptr(unsafe.Pointer(&v)), 2) // ERROR "live at call to mallocgcSmallNoScanSC[0-9]+: .?autotmp" "live at call to T.M2: .?autotmp"  "escapes to heap" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
+       t.M2(0, 1, uintptr(unsafe.Pointer(&v)), 2) // ERROR "live at call to (newobject|mallocgcSmallNoScanSC[0-9]+): .?autotmp" "live at call to T.M2: .?autotmp"  "escapes to heap" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
 }