1 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
2 target triple = "aarch64-unknown-linux"
4 attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
6 define dso_local void @Write1(i8* %p) #0 {
8 store i8 0, i8* %p, align 1
12 define dso_local void @Write4(i8* %p) #0 {
14 %0 = bitcast i8* %p to i32*
15 store i32 0, i32* %0, align 1
19 define dso_local void @Write4_2(i8* %p, i8* %q) #0 {
21 %0 = bitcast i8* %p to i32*
22 store i32 0, i32* %0, align 1
23 %1 = bitcast i8* %q to i32*
24 store i32 0, i32* %1, align 1
28 define dso_local void @Write8(i8* %p) #0 {
30 %0 = bitcast i8* %p to i64*
31 store i64 0, i64* %0, align 1
35 define dso_local i8* @WriteAndReturn8(i8* %p) #0 {
37 store i8 0, i8* %p, align 1
41 declare dso_local void @ExternalCall(i8* %p)
43 define dso_preemptable void @PreemptableWrite1(i8* %p) #0 {
45 store i8 0, i8* %p, align 1
49 define linkonce dso_local void @InterposableWrite1(i8* %p) #0 {
51 store i8 0, i8* %p, align 1
55 define dso_local i8* @ReturnDependent(i8* %p) #0 {
57 %p2 = getelementptr i8, i8* %p, i64 2
62 define dso_local void @Rec0(i8* %p) #0 {
64 %p1 = getelementptr i8, i8* %p, i64 2
65 call void @Write4(i8* %p1)
70 define dso_local void @Rec1(i8* %p) #0 {
72 %p1 = getelementptr i8, i8* %p, i64 1
73 call void @Rec0(i8* %p1)
77 ; access range [-2, 2)
78 define dso_local void @Rec2(i8* %p) #0 {
80 %p1 = getelementptr i8, i8* %p, i64 -5
81 call void @Rec1(i8* %p1)
85 ; Recursive function that passes %acc unchanged => access range [0, 4).
86 define dso_local void @RecursiveNoOffset(i32* %p, i32 %size, i32* %acc) {
88 %cmp = icmp eq i32 %size, 0
89 br i1 %cmp, label %return, label %if.end
92 %0 = load i32, i32* %p, align 4
93 %1 = load i32, i32* %acc, align 4
94 %add = add nsw i32 %1, %0
95 store i32 %add, i32* %acc, align 4
96 %add.ptr = getelementptr inbounds i32, i32* %p, i64 1
97 %sub = add nsw i32 %size, -1
98 tail call void @RecursiveNoOffset(i32* %add.ptr, i32 %sub, i32* %acc)
105 ; Recursive function that advances %acc on each iteration => access range unlimited.
106 define dso_local void @RecursiveWithOffset(i32 %size, i32* %acc) {
108 %cmp = icmp eq i32 %size, 0
109 br i1 %cmp, label %return, label %if.end
112 store i32 0, i32* %acc, align 4
113 %acc2 = getelementptr inbounds i32, i32* %acc, i64 1
114 %sub = add nsw i32 %size, -1
115 tail call void @RecursiveWithOffset(i32 %sub, i32* %acc2)
122 define dso_local i64* @ReturnAlloca() {
124 %x = alloca i64, align 4
128 define dso_local void @Write1Private(i8* %p) #0 {
130 call void @Private(i8* %p)
134 define dso_local void @Write1SameModule(i8* %p) #0 {
136 call void @Write1(i8* %p)
140 declare void @Write1Module0(i8* %p)
142 define dso_local void @Write1DiffModule(i8* %p) #0 {
144 call void @Write1Module0(i8* %p)
148 define private dso_local void @Private(i8* %p) #0 {
150 %p1 = getelementptr i8, i8* %p, i64 -1
151 store i8 0, i8* %p1, align 1
155 define dso_local void @Write1Weak(i8* %p) #0 {
157 call void @Weak(i8* %p)
161 define weak dso_local void @Weak(i8* %p) #0 {
163 %p1 = getelementptr i8, i8* %p, i64 -1
164 store i8 0, i8* %p1, align 1