diff options
author | Kostya Serebryany <kcc@google.com> | 2012-05-30 09:04:06 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-05-30 09:04:06 +0000 |
commit | e6cf2e0bd09544eeb69665deb908d264e62a71c2 (patch) | |
tree | 4789bf717e4a2896273015a36a28ac5e2f260dde /test/Instrumentation | |
parent | fe3516f9a5f238ecf6872b5315706c7c7942a496 (diff) | |
download | external_llvm-e6cf2e0bd09544eeb69665deb908d264e62a71c2.zip external_llvm-e6cf2e0bd09544eeb69665deb908d264e62a71c2.tar.gz external_llvm-e6cf2e0bd09544eeb69665deb908d264e62a71c2.tar.bz2 |
[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.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Instrumentation/AddressSanitizer/test64.ll b/test/Instrumentation/AddressSanitizer/test64.ll index fc27de9..d544d77 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 |