Skip to content

Commit d50a571

Browse files
matloobgopherbot
authored andcommitted
test: fix tests to work with sizespecializedmalloc turned off
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 <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
1 parent 704f841 commit d50a571

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

test/codegen/strings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func CountBytes(s []byte) int {
2323

2424
func ToByteSlice() []byte { // Issue #24698
2525
// amd64:`LEAQ type:\[3\]uint8`
26-
// amd64:`CALL runtime\.mallocTiny3`
26+
// amd64:`CALL runtime\.(newobject|mallocTiny3)`
2727
// amd64:-`.*runtime.stringtoslicebyte`
2828
return []byte("foo")
2929
}

test/fixedbugs/issue15747.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type T struct{ M string }
1919

2020
var b bool
2121

22-
func f1(q *Q, xx []byte) interface{} { // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: xx$" "live at entry to f1: xx$"
22+
func f1(q *Q, xx []byte) interface{} { // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): xx$" "live at entry to f1: xx$"
2323
// xx was copied from the stack to the heap on the previous line:
2424
// xx was live for the first two prints but then it switched to &xx
2525
// 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
3636
//go:noinline
3737
func f2(d []byte, n int) (odata, res []byte, e interface{}) { // ERROR "live at entry to f2: d$"
3838
if n > len(d) {
39-
return d, nil, &T{M: "hello"} // ERROR "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: d"
39+
return d, nil, &T{M: "hello"} // ERROR "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+)+: d"
4040
}
4141
res = d[:n]
4242
odata = d[n:]

test/live.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ func f27defer(b bool) {
467467
func f27go(b bool) {
468468
x := 0
469469
if b {
470-
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
470+
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
471471
}
472-
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
472+
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
473473
printnl()
474474
}
475475

@@ -538,7 +538,7 @@ func f31(b1, b2, b3 bool) {
538538
g31(g18()) // ERROR "stack object .autotmp_[0-9]+ \[2\]string$"
539539
}
540540
if b2 {
541-
h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: .autotmp_[0-9]+$"
541+
h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): .autotmp_[0-9]+$"
542542
}
543543
if b3 {
544544
panic(g18())
@@ -665,14 +665,14 @@ func f39a() (x []int) {
665665

666666
func f39b() (x [10]*int) {
667667
x = [10]*int{}
668-
x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
668+
x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
669669
printnl() // ERROR "live at call to printnl: x$"
670670
return x
671671
}
672672

673673
func f39c() (x [10]*int) {
674674
x = [10]*int{}
675-
x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
675+
x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
676676
printnl() // ERROR "live at call to printnl: x$"
677677
return
678678
}

test/live_regabi.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,9 @@ func f27defer(b bool) {
465465
func f27go(b bool) {
466466
x := 0
467467
if b {
468-
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
468+
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
469469
}
470-
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
470+
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
471471
printnl()
472472
}
473473

@@ -536,7 +536,7 @@ func f31(b1, b2, b3 bool) {
536536
g31(g18()) // ERROR "stack object .autotmp_[0-9]+ \[2\]string$"
537537
}
538538
if b2 {
539-
h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to mallocgcSmallScanNoHeaderSC[0-9]+: .autotmp_[0-9]+$"
539+
h31(g18()) // ERROR "live at call to convT: .autotmp_[0-9]+$" "live at call to (newobject|mallocgcSmallScanNoHeaderSC[0-9]+): .autotmp_[0-9]+$"
540540
}
541541
if b3 {
542542
panic(g18())
@@ -663,14 +663,14 @@ func f39a() (x []int) {
663663

664664
func f39b() (x [10]*int) {
665665
x = [10]*int{}
666-
x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
666+
x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
667667
printnl() // ERROR "live at call to printnl: x$"
668668
return x
669669
}
670670

671671
func f39c() (x [10]*int) {
672672
x = [10]*int{}
673-
x[0] = new(int) // ERROR "live at call to mallocTiny[48]: x$"
673+
x[0] = new(int) // ERROR "live at call to (newobject|mallocTiny[48]): x$"
674674
printnl() // ERROR "live at call to printnl: x$"
675675
return
676676
}

test/uintptrescapes2.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ func TestM1() {
5050

5151
func TestF2() {
5252
var v int // ERROR "moved to heap"
53-
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$"
53+
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$"
5454
}
5555

5656
func TestF4() {
5757
var v2 int // ERROR "moved to heap"
58-
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$"
58+
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$"
5959
}
6060

6161
func TestM2() {
6262
var t T
6363
var v int // ERROR "moved to heap"
64-
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$"
64+
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$"
6565
}

0 commit comments

Comments
 (0)