3 // Copyright 2019 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
13 defer f(new(int)) // ERROR "... argument does not escape$" "new\(int\) does not escape$"
14 defer f(new(int), new(int)) // ERROR "... argument does not escape$" "new\(int\) does not escape$"
17 defer f([]*int{}...) // ERROR "\[\]\*int{} does not escape$"
18 defer f([]*int{new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) does not escape$"
19 defer f([]*int{new(int), new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) does not escape$"
22 go f(new(int)) // ERROR "... argument does not escape$" "new\(int\) escapes to heap$"
23 go f(new(int), new(int)) // ERROR "... argument does not escape$" "new\(int\) escapes to heap$"
26 go f([]*int{}...) // ERROR "\[\]\*int{} does not escape$"
27 go f([]*int{new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) escapes to heap$"
28 go f([]*int{new(int), new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) escapes to heap$"
32 defer f(new(int)) // ERROR "... argument does not escape$" "new\(int\) escapes to heap$"
33 defer f(new(int), new(int)) // ERROR "... argument does not escape$" "new\(int\) escapes to heap$"
36 defer f([]*int{}...) // ERROR "\[\]\*int{} does not escape$"
37 defer f([]*int{new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) escapes to heap$"
38 defer f([]*int{new(int), new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) escapes to heap$"
41 go f(new(int)) // ERROR "... argument does not escape$" "new\(int\) escapes to heap$"
42 go f(new(int), new(int)) // ERROR "... argument does not escape$" "new\(int\) escapes to heap$"
45 go f([]*int{}...) // ERROR "\[\]\*int{} does not escape$"
46 go f([]*int{new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) escapes to heap$"
47 go f([]*int{new(int), new(int)}...) // ERROR "\[\]\*int{...} does not escape$" "new\(int\) escapes to heap$"