[test][msan] Test origin description argument
authorVitaly Buka <vitalybuka@google.com>
Thu, 11 Aug 2022 21:10:55 +0000 (14:10 -0700)
committerVitaly Buka <vitalybuka@google.com>
Thu, 11 Aug 2022 21:29:09 +0000 (14:29 -0700)
Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D131721

llvm/test/Instrumentation/MemorySanitizer/alloca.ll

index a3a807a..2fc50ac 100644 (file)
 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-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
+; ORIGIN: [[D:@[0-9]+]] = private global [13 x i8] c"----unique_x\00"
+
 define void @static() sanitize_memory {
 entry:
-  %x = alloca i32, align 4
+  %unique_x = alloca i32, align 4
   ret void
 }
 
 ; CHECK-LABEL: define void @static(
 ; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 4, i1 false)
 ; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 4)
-; ORIGIN: call void @__msan_set_alloca_origin(i8* {{.*}}, i64 4,
+; ORIGIN: call void @__msan_set_alloca_origin(i8* {{.*}}, i64 4, i8* {{.*}} [[D]],
 ; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 4,
 ; CHECK: ret void