update tests

Change-Id: If229448904be3f8fe4a013cba2f74856b0e79f60
This commit is contained in:
Mateusz Poliwczak 2025-02-12 20:00:06 +01:00
parent 3e4916fbf0
commit a6e512ca76
3 changed files with 5 additions and 5 deletions

View File

@ -123,7 +123,7 @@ func doesMakeSlice(x *string, y *string) { // ERROR "leaking param: x" "leaking
func nonconstArray() {
n := 32
s1 := make([]int, n) // ERROR "make\(\[\]int, n\) escapes to heap"
s2 := make([]int, 0, n) // ERROR "make\(\[\]int, 0, n\) escapes to heap"
s1 := make([]int, n) // ERROR "make\(\[\]int, 32\) does not escape"
s2 := make([]int, 0, n) // ERROR "make\(\[\]int, 0, 32\) does not escape"
_, _ = s1, s2
}

View File

@ -96,7 +96,7 @@ func slice10() []*int {
func slice11() {
i := 2
s := make([]int, 2, 3) // ERROR "make\(\[\]int, 2, 3\) does not escape"
s = make([]int, i, 3) // ERROR "make\(\[\]int, i, 3\) does not escape"
s = make([]int, i, 3) // ERROR "make\(\[\]int, 2, 3\) does not escape"
s = make([]int, i, 1) // ERROR "make\(\[\]int, i, 1\) does not escape"
_ = s
}

View File

@ -12,6 +12,6 @@ func f() { // ERROR ""
_ = make([]byte, 100, 1<<17) // ERROR "too large for stack" ""
_ = make([]byte, n, 1<<17) // ERROR "too large for stack" ""
_ = make([]byte, n) // ERROR "non-constant size" ""
_ = make([]byte, 100, m) // ERROR "non-constant size" ""
_ = make([]byte, n) // ERROR "does not escape"
_ = make([]byte, 100, m) // ERROR "does not escape"
}