aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-09 05:44:59 +0000
committerChris Lattner <sabre@nondot.org>2009-03-09 05:44:59 +0000
commit339c93b0743fca0796f08cc294c7bf9e592b78b2 (patch)
tree21defcf780eddb3245abece029d4ba6d09c9a1b1
parentf1a3082513c94bc5ed2a6a3e2fb6cf9b9a8ac157 (diff)
testcase for PR3744
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66401 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/FrontendC/2009-03-08-ZeroEltStructCrash.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/FrontendC/2009-03-08-ZeroEltStructCrash.c b/test/FrontendC/2009-03-08-ZeroEltStructCrash.c
new file mode 100644
index 0000000000..454e0fb79c
--- /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);
+}