Cherry Zhang | 8ff4260 | 2016-08-30 09:12:22 -0400 | [diff] [blame] | 1 | // errorcheck -0 -d=ssa/intrinsics/debug |
Cherry Zhang | d63de28 | 2017-10-05 10:11:38 -0400 | [diff] [blame] | 2 | // +build amd64 arm64 mips mipsle mips64 mips64le ppc64 ppc64le s390x |
Cherry Zhang | 644c16c | 2016-09-06 08:48:14 -0400 | [diff] [blame] | 3 | |
| 4 | // Copyright 2016 The Go Authors. All rights reserved. |
| 5 | // Use of this source code is governed by a BSD-style |
| 6 | // license that can be found in the LICENSE file. |
| 7 | |
| 8 | package main |
| 9 | |
| 10 | import "sync/atomic" |
| 11 | |
| 12 | var x uint32 |
| 13 | |
| 14 | func atomics() { |
| 15 | _ = atomic.LoadUint32(&x) // ERROR "intrinsic substitution for LoadUint32" |
| 16 | atomic.StoreUint32(&x, 1) // ERROR "intrinsic substitution for StoreUint32" |
| 17 | atomic.AddUint32(&x, 1) // ERROR "intrinsic substitution for AddUint32" |
| 18 | atomic.SwapUint32(&x, 1) // ERROR "intrinsic substitution for SwapUint32" |
| 19 | atomic.CompareAndSwapUint32(&x, 1, 2) // ERROR "intrinsic substitution for CompareAndSwapUint32" |
| 20 | } |