summaryrefslogtreecommitdiff
path: root/test/Instrumentation
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-05-30 09:04:06 +0000
committerKostya Serebryany <kcc@google.com>2012-05-30 09:04:06 +0000
commite6cf2e0bd09544eeb69665deb908d264e62a71c2 (patch)
tree4789bf717e4a2896273015a36a28ac5e2f260dde /test/Instrumentation
parentfe3516f9a5f238ecf6872b5315706c7c7942a496 (diff)
downloadllvm-e6cf2e0bd09544eeb69665deb908d264e62a71c2.tar.gz
llvm-e6cf2e0bd09544eeb69665deb908d264e62a71c2.tar.bz2
llvm-e6cf2e0bd09544eeb69665deb908d264e62a71c2.tar.xz
[asan] instrument cmpxchg and atomicrmw
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r--test/Instrumentation/AddressSanitizer/test64.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Instrumentation/AddressSanitizer/test64.ll b/test/Instrumentation/AddressSanitizer/test64.ll
index fc27de914d..d544d77b93 100644
--- a/test/Instrumentation/AddressSanitizer/test64.ll
+++ b/test/Instrumentation/AddressSanitizer/test64.ll
@@ -12,3 +12,25 @@ entry:
; Check for ASAN's Offset for 64-bit (2^44)
; CHECK-NEXT: 17592186044416
; CHECK: ret
+
+define void @example_atomicrmw(i64* %ptr) nounwind uwtable address_safety {
+entry:
+ %0 = atomicrmw add i64* %ptr, i64 1 seq_cst
+ ret void
+}
+
+; CHECK: @example_atomicrmw
+; CHECK: lshr {{.*}} 3
+; CHECK: atomicrmw
+; CHECK: ret
+
+define void @example_cmpxchg(i64* %ptr, i64 %compare_to, i64 %new_value) nounwind uwtable address_safety {
+entry:
+ %0 = cmpxchg i64* %ptr, i64 %compare_to, i64 %new_value seq_cst
+ ret void
+}
+
+; CHECK: @example_cmpxchg
+; CHECK: lshr {{.*}} 3
+; CHECK: cmpxchg
+; CHECK: ret