implement a tiny amount of codegen support for gnu array range
designators: allowing codegen when the element initializer is a
constant or something else without a side effect. This unblocks
enough to let process.c in the linux kernel build, PR9257.
llvm-svn: 126056
diff --git a/clang/test/CodeGen/init.c b/clang/test/CodeGen/init.c
index ccb04f3..0f94729 100644
--- a/clang/test/CodeGen/init.c
+++ b/clang/test/CodeGen/init.c
@@ -100,3 +100,18 @@
// CHECK-NOT: store i32 0
// CHECK: call void @bar
}
+
+
+// PR9257
+struct test11S {
+ int A[10];
+};
+void test11(struct test11S *P) {
+ *P = (struct test11S) { .A = { [0 ... 3] = 4 } };
+ // CHECK: @test11
+ // CHECK: store i32 4
+ // CHECK: store i32 4
+ // CHECK: store i32 4
+ // CHECK: store i32 4
+ // CHECK: ret void
+}