testcase for PR3744


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66401 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/FrontendC/2009-03-08-ZeroEltStructCrash.c b/test/FrontendC/2009-03-08-ZeroEltStructCrash.c
new file mode 100644
index 0000000..454e0fb
--- /dev/null
+++ b/test/FrontendC/2009-03-08-ZeroEltStructCrash.c
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S %s -o - 
+// PR3744
+struct Empty {};
+struct Union {
+ union {
+   int zero_arr[0];
+ } contents;
+};
+static inline void Foo(struct Union *u) {
+ int *array = u->contents.zero_arr;
+}
+static void Bar(struct Union *u) {
+ Foo(u);
+}