66; RUN: -passes=msan 2>&1 | FileCheck %s "--check-prefixes=CHECK,ORIGIN"
77; RUN: opt < %s -msan-check-access-address=0 -msan-track-origins=2 -S \
88; RUN: -passes=msan 2>&1 | FileCheck %s "--check-prefixes=CHECK,ORIGIN"
9+ ; RUN: opt < %s -msan-check-access-address=0 -msan-track-origins=2 -msan-print-stack-names=false -S \
10+ ; RUN: -passes=msan 2>&1 | FileCheck %s "--check-prefixes=CHECK,ORIGIN-LEAN"
911; RUN: opt < %s -S -passes="msan<kernel>" 2>&1 | FileCheck %s \
1012; RUN: "--check-prefixes=CHECK,KMSAN"
1113; RUN: opt < %s -msan-kernel=1 -S -passes=msan 2>&1 | FileCheck %s \
@@ -15,6 +17,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
1517target triple = "x86_64-unknown-linux-gnu"
1618
1719; ORIGIN: [[IDPTR:@[0-9]+]] = private global i32 0
20+ ; ORIGIN-LEAN: [[IDPTR:@[0-9]+]] = private global i32 0
1821; ORIGIN: [[DESCR:@[0-9]+]] = private constant [9 x i8] c"unique_x\00"
1922
2023define void @static () sanitize_memory {
2730; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
2831; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
2932; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4, i8* {{.*}} [[IDPTR]] {{.*}}, i8* {{.*}} [[DESCR]],
33+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4, i8* {{.*}} [[IDPTR]]
3034; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
3135; CHECK: ret void
3236
4347; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
4448; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
4549; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
50+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
4651; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
4752; CHECK: ret void
4853
5661; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 20, i1 false)
5762; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 20)
5863; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 20,
64+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 20,
5965; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 20,
6066; CHECK: ret void
6167
7076; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 %[[A]], i1 false)
7177; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 %[[A]])
7278; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 %[[A]],
79+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 %[[A]],
7380; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 %[[A]],
7481; CHECK: ret void
7582
8491; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 0, i64 20, i1 false)
8592; CALL: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 0, i64 20, i1 false)
8693; ORIGIN-NOT: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 20,
94+ ; ORIGIN-LEAN-NOT: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 20,
8795; KMSAN: call void @__msan_unpoison_alloca(i8* {{.*}}, i64 20)
8896; CHECK: ret void
8997
@@ -113,12 +121,14 @@ another_bb:
113121; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
114122; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
115123; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
124+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
116125; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
117126
118127; CHECK: call void @llvm.lifetime.start
119128; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
120129; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
121130; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
131+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
122132; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
123133; CHECK: ret void
124134
@@ -140,6 +150,7 @@ entry:
140150; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 %[[A]], i1 false)
141151; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 %[[A]])
142152; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 %[[A]],
153+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 %[[A]],
143154; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 %[[A]],
144155; CHECK: call void @llvm.lifetime.end
145156; CHECK: ret void
@@ -180,35 +191,41 @@ another_bb:
180191; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
181192; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
182193; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
194+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
183195; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
184196; CHECK: %y = alloca i32
185197; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
186198; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
187199; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
200+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
188201; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
189202; CHECK: %z = alloca i32
190203; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
191204; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
192205; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
206+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
193207; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
194208
195209; There're two lifetime intrinsics for %z, but we must instrument it only once.
196210; INLINE-NOT: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
197211; CALL-NOT: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
198212; ORIGIN-NOT: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
213+ ; ORIGIN-LEAN-NOT: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
199214; KMSAN-NOT: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
200215; CHECK-LABEL: another_bb:
201216
202217; CHECK: call void @llvm.lifetime.start
203218; INLINE-NOT: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
204219; CALL-NOT: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
205220; ORIGIN-NOT: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
221+ ; ORIGIN-LEAN-NOT: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
206222; KMSAN-NOT: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
207223; CHECK: call void @llvm.lifetime.end
208224; CHECK: call void @llvm.lifetime.start
209225; INLINE-NOT: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
210226; CALL-NOT: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
211227; ORIGIN-NOT: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 4,
228+ ; ORIGIN-LEAN-NOT: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 4,
212229; KMSAN-NOT: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
213230; CHECK: call void @llvm.lifetime.end
214231
0 commit comments