mirror of https://github.com/golang/go.git
update tests
Change-Id: If229448904be3f8fe4a013cba2f74856b0e79f60
This commit is contained in:
parent
3e4916fbf0
commit
a6e512ca76
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue