3 // Copyright 2012 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.
7 // Issue 4463: test builtin functions in statement context and in
20 append(a
, 0) // ERROR "not used"
21 cap(a
) // ERROR "not used"
22 complex(1, 2) // ERROR "not used"
23 imag(1i
) // ERROR "not used"
24 len(a
) // ERROR "not used"
25 make([]int, 10) // ERROR "not used"
26 new(int) // ERROR "not used"
27 real(1i
) // ERROR "not used"
28 unsafe
.Alignof(a
) // ERROR "not used"
29 unsafe
.Offsetof(s
.f
) // ERROR "not used"
30 unsafe
.Sizeof(a
) // ERROR "not used"
48 go append(a
, 0) // ERROR "not used|discards result"
49 go cap(a
) // ERROR "not used|discards result"
50 go complex(1, 2) // ERROR "not used|discards result"
51 go imag(1i
) // ERROR "not used|discards result"
52 go len(a
) // ERROR "not used|discards result"
53 go make([]int, 10) // ERROR "not used|discards result"
54 go new(int) // ERROR "not used|discards result"
55 go real(1i
) // ERROR "not used|discards result"
56 go unsafe
.Alignof(a
) // ERROR "not used|discards result"
57 go unsafe
.Offsetof(s
.f
) // ERROR "not used|discards result"
58 go unsafe
.Sizeof(a
) // ERROR "not used|discards result"
68 defer append(a
, 0) // ERROR "not used|discards result"
69 defer cap(a
) // ERROR "not used|discards result"
70 defer complex(1, 2) // ERROR "not used|discards result"
71 defer imag(1i
) // ERROR "not used|discards result"
72 defer len(a
) // ERROR "not used|discards result"
73 defer make([]int, 10) // ERROR "not used|discards result"
74 defer new(int) // ERROR "not used|discards result"
75 defer real(1i
) // ERROR "not used|discards result"
76 defer unsafe
.Alignof(a
) // ERROR "not used|discards result"
77 defer unsafe
.Offsetof(s
.f
) // ERROR "not used|discards result"
78 defer unsafe
.Sizeof(a
) // ERROR "not used|discards result"