@@ -72,6 +72,20 @@ entry:
72
72
; KMSAN: call void @__msan_poison_alloca(ptr {{.*}}, i64 20,
73
73
; CHECK: ret void
74
74
75
+ define void @array32 () sanitize_memory {
76
+ entry:
77
+ %x = alloca i32 , i32 5 , align 4
78
+ ret void
79
+ }
80
+
81
+ ; CHECK-LABEL: define void @array32(
82
+ ; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 20, i1 false)
83
+ ; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 20)
84
+ ; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 20,
85
+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 20,
86
+ ; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 20,
87
+ ; CHECK: ret void
88
+
75
89
define void @array_non_const (i64 %cnt ) sanitize_memory {
76
90
entry:
77
91
%x = alloca i32 , i64 %cnt , align 4
@@ -103,6 +117,22 @@ entry:
103
117
; KMSAN: call void @__msan_poison_alloca(ptr {{.*}}, i64 %[[A]],
104
118
; CHECK: ret void
105
119
120
+ define void @array_non_const32 (i32 %cnt ) sanitize_memory {
121
+ entry:
122
+ %x = alloca i32 , i32 %cnt , align 4
123
+ ret void
124
+ }
125
+
126
+ ; CHECK-LABEL: define void @array_non_const32(
127
+ ; CHECK: %[[Z:.*]] = zext i32 %cnt to i64
128
+ ; CHECK: %[[A:.*]] = mul i64 4, %[[Z]]
129
+ ; INLINE: call void @llvm.memset.p0i8.i64(i8* align 4 {{.*}}, i8 -1, i64 %[[A]], i1 false)
130
+ ; CALL: call void @__msan_poison_stack(i8* {{.*}}, i64 %[[A]])
131
+ ; ORIGIN: call void @__msan_set_alloca_origin_with_descr(i8* {{.*}}, i64 %[[A]],
132
+ ; ORIGIN-LEAN: call void @__msan_set_alloca_origin_no_descr(i8* {{.*}}, i64 %[[A]],
133
+ ; KMSAN: call void @__msan_poison_alloca(i8* {{.*}}, i64 %[[A]],
134
+ ; CHECK: ret void
135
+
106
136
; Check that the local is unpoisoned in the absence of sanitize_memory
107
137
define void @unpoison_local () {
108
138
entry:
0 commit comments