Source file test/fixedbugs/issue16241_64.go

     1  //go:build !(386 || arm || mips || mipsle)
     2  
     3  // errorcheck -0 -m -l
     4  
     5  // Copyright 2023 The Go Authors. All rights reserved.
     6  // Use of this source code is governed by a BSD-style
     7  // license that can be found in the LICENSE file.
     8  
     9  package foo
    10  
    11  import "sync/atomic"
    12  
    13  func AddInt64(x *int64) { // ERROR "x does not escape$"
    14  	atomic.AddInt64(x, 42)
    15  }
    16  func AddUint64(x *uint64) { // ERROR "x does not escape$"
    17  	atomic.AddUint64(x, 42)
    18  }
    19  
    20  func AndInt64(x *int64) { // ERROR "x does not escape$"
    21  	atomic.AndInt64(x, 42)
    22  }
    23  func AndUint64(x *uint64) { // ERROR "x does not escape$"
    24  	atomic.AndUint64(x, 42)
    25  }
    26  
    27  func CompareAndSwapInt64(x *int64) { // ERROR "x does not escape$"
    28  	atomic.CompareAndSwapInt64(x, 42, 42)
    29  }
    30  func CompareAndSwapUint64(x *uint64) { // ERROR "x does not escape$"
    31  	atomic.CompareAndSwapUint64(x, 42, 42)
    32  }
    33  
    34  func LoadInt64(x *int64) { // ERROR "x does not escape$"
    35  	atomic.LoadInt64(x)
    36  }
    37  func LoadUint64(x *uint64) { // ERROR "x does not escape$"
    38  	atomic.LoadUint64(x)
    39  }
    40  
    41  func OrInt64(x *int64) { // ERROR "x does not escape$"
    42  	atomic.OrInt64(x, 42)
    43  }
    44  func OrUint64(x *uint64) { // ERROR "x does not escape$"
    45  	atomic.OrUint64(x, 42)
    46  }
    47  
    48  func StoreInt64(x *int64) { // ERROR "x does not escape$"
    49  	atomic.StoreInt64(x, 42)
    50  }
    51  func StoreUint64(x *uint64) { // ERROR "x does not escape$"
    52  	atomic.StoreUint64(x, 42)
    53  }
    54  
    55  func SwapInt64(x *int64) { // ERROR "x does not escape$"
    56  	atomic.SwapInt64(x, 42)
    57  }
    58  func SwapUint64(x *uint64) { // ERROR "x does not escape$"
    59  	atomic.SwapUint64(x, 42)
    60  }
    61  

View as plain text