Debian Codegraph @

test/fixedbugs/issue16241.go

raw
1 // errorcheck -0 -m -l
2
3 // Copyright 2023 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.
6
7 package foo
8
9 import "sync/atomic"
10
11 func AddInt32(x *int32) { // ERROR "x does not escape$"
12 atomic.AddInt32(x, 42)
13 }
14 func AddUint32(x *uint32) { // ERROR "x does not escape$"
15 atomic.AddUint32(x, 42)
16 }
17 func AddUintptr(x *uintptr) { // ERROR "x does not escape$"
18 atomic.AddUintptr(x, 42)
19 }
20
21 func AndInt32(x *int32) { // ERROR "x does not escape$"
22 atomic.AndInt32(x, 42)
23 }
24 func AndUint32(x *uint32) { // ERROR "x does not escape$"
25 atomic.AndUint32(x, 42)
26 }
27 func AndUintptr(x *uintptr) { // ERROR "x does not escape$"
28 atomic.AndUintptr(x, 42)
29 }
30
31 func CompareAndSwapInt32(x *int32) { // ERROR "x does not escape$"
32 atomic.CompareAndSwapInt32(x, 42, 42)
33 }
34 func CompareAndSwapUint32(x *uint32) { // ERROR "x does not escape$"
35 atomic.CompareAndSwapUint32(x, 42, 42)
36 }
37 func CompareAndSwapUintptr(x *uintptr) { // ERROR "x does not escape$"
38 atomic.CompareAndSwapUintptr(x, 42, 42)
39 }
40
41 func LoadInt32(x *int32) { // ERROR "x does not escape$"
42 atomic.LoadInt32(x)
43 }
44 func LoadUint32(x *uint32) { // ERROR "x does not escape$"
45 atomic.LoadUint32(x)
46 }
47 func LoadUintptr(x *uintptr) { // ERROR "x does not escape$"
48 atomic.LoadUintptr(x)
49 }
50
51 func OrInt32(x *int32) { // ERROR "x does not escape$"
52 atomic.OrInt32(x, 42)
53 }
54 func OrUint32(x *uint32) { // ERROR "x does not escape$"
55 atomic.OrUint32(x, 42)
56 }
57 func OrUintptr(x *uintptr) { // ERROR "x does not escape$"
58 atomic.OrUintptr(x, 42)
59 }
60
61 func StoreInt32(x *int32) { // ERROR "x does not escape$"
62 atomic.StoreInt32(x, 42)
63 }
64 func StoreUint32(x *uint32) { // ERROR "x does not escape$"
65 atomic.StoreUint32(x, 42)
66 }
67 func StoreUintptr(x *uintptr) { // ERROR "x does not escape$"
68 atomic.StoreUintptr(x, 42)
69 }
70
71 func SwapInt32(x *int32) { // ERROR "x does not escape$"
72 atomic.SwapInt32(x, 42)
73 }
74 func SwapUint32(x *uint32) { // ERROR "x does not escape$"
75 atomic.SwapUint32(x, 42)
76 }
77 func SwapUintptr(x *uintptr) { // ERROR "x does not escape$"
78 atomic.SwapUintptr(x, 42)
79 }