aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/init.c')
-rw-r--r--test/CodeGen/init.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/init.c b/test/CodeGen/init.c
index 2dee0432ef..ccb04f343c 100644
--- a/test/CodeGen/init.c
+++ b/test/CodeGen/init.c
@@ -70,3 +70,33 @@ char test8(int X) {
// CHECK: store i8 98
// CHECK: store i8 99
}
+
+void bar(void*);
+
+// PR279
+int test9(int X) {
+ int Arr[100] = { X }; // Should use memset
+ bar(Arr);
+// CHECK: @test9
+// CHECK: call void @llvm.memset
+// CHECK-NOT: store i32 0
+// CHECK: call void @bar
+}
+
+struct a {
+ int a, b, c, d, e, f, g, h, i, j, k, *p;
+};
+
+struct b {
+ struct a a,b,c,d,e,f,g;
+};
+
+int test10(int X) {
+ struct b S = { .a.a = X, .d.e = X, .f.e = 0, .f.f = 0, .f.p = 0 };
+ bar(&S);
+
+ // CHECK: @test10
+ // CHECK: call void @llvm.memset
+ // CHECK-NOT: store i32 0
+ // CHECK: call void @bar
+}