1 ; RUN: opt < %s -passes=asan -S | FileCheck --check-prefixes=CHECK,CHECK-S3 %s
2 ; RUN: opt < %s -passes=asan -asan-mapping-scale=5 -S | FileCheck --check-prefixes=CHECK,CHECK-S5 %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
4 target triple = "x86_64-unknown-linux-gnu"
5 define i32 @read_4_bytes(ptr %a) sanitize_address {
7 %tmp1 = load i32, ptr %a, align 4
10 ; CHECK-LABEL: @read_4_bytes
12 ; CHECK-S3: lshr {{.*}} 3
13 ; CHECK-S5: lshr {{.*}} 5
14 ; Check for ASAN's Offset for 64-bit (7fff8000|7ffe0000)
15 ; CHECK-S3-NEXT: add{{.*}}2147450880
16 ; CHECK-S5-NEXT: add{{.*}}2147352576
19 define void @example_atomicrmw(ptr %ptr) nounwind uwtable sanitize_address {
21 %0 = atomicrmw add ptr %ptr, i64 1 seq_cst
25 ; CHECK-LABEL: @example_atomicrmw
26 ; CHECK-S3: lshr {{.*}} 3
27 ; CHECK-S5: lshr {{.*}} 5
28 ; CHECK: __asan_report_store8
29 ; CHECK-NOT: __asan_report
33 define void @example_cmpxchg(ptr %ptr, i64 %compare_to, i64 %new_value) nounwind uwtable sanitize_address {
35 %0 = cmpxchg ptr %ptr, i64 %compare_to, i64 %new_value seq_cst seq_cst
39 ; CHECK-LABEL: @example_cmpxchg
40 ; CHECK-S3: lshr {{.*}} 3
41 ; CHECK-S5: lshr {{.*}} 5
42 ; CHECK: __asan_report_store8
43 ; CHECK-NOT: __asan_report