aboutsummaryrefslogtreecommitdiff
path: root/src/sync
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2019-10-21 17:06:02 -0700
committerMatthew Dempsky <mdempsky@google.com>2019-10-22 18:09:03 +0000
commita97ccc894032d646e3003f061704ca59cac2587f (patch)
tree7fcbe3387d6c1cc2d5402ee3a70683a9a04dbbf1 /src/sync
parent22278ca0d4f0ecdc5e9d2884b771062cbb3e837a (diff)
downloadgo-a97ccc894032d646e3003f061704ca59cac2587f.tar.gz
go-a97ccc894032d646e3003f061704ca59cac2587f.zip
sync/atomic: suppress checkptr errors for hammerStoreLoadPointer
This test could be updated to use unsafe.Pointer arithmetic properly (e.g., see discussion at #34972), but it doesn't seem worthwhile. The test is just checking that LoadPointer and StorePointer are atomic. Updates #34972. Change-Id: I85a8d610c1766cd63136cae686aa8a240a362a18 Reviewed-on: https://go-review.googlesource.com/c/go/+/202597 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/sync')
-rw-r--r--src/sync/atomic/atomic_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sync/atomic/atomic_test.go b/src/sync/atomic/atomic_test.go
index 135f02a726..286eadc6cd 100644
--- a/src/sync/atomic/atomic_test.go
+++ b/src/sync/atomic/atomic_test.go
@@ -1140,6 +1140,9 @@ func hammerStoreLoadUintptr(t *testing.T, paddr unsafe.Pointer) {
StoreUintptr(addr, new)
}
+//go:nocheckptr
+// This code is just testing that LoadPointer/StorePointer operate
+// atomically; it's not actually calculating pointers.
func hammerStoreLoadPointer(t *testing.T, paddr unsafe.Pointer) {
addr := (*unsafe.Pointer)(paddr)
v := uintptr(LoadPointer(addr))