OSDN Git Service

testcase for PR3744
authorChris Lattner <sabre@nondot.org>
Mon, 9 Mar 2009 05:44:59 +0000 (05:44 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 9 Mar 2009 05:44:59 +0000 (05:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66401 91177308-0d34-0410-b5e6-96231b3b80d8

test/FrontendC/2009-03-08-ZeroEltStructCrash.c [new file with mode: 0644]

diff --git a/test/FrontendC/2009-03-08-ZeroEltStructCrash.c b/test/FrontendC/2009-03-08-ZeroEltStructCrash.c
new file mode 100644 (file)
index 0000000..454e0fb
--- /dev/null
@@ -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);
+}