From 1b64141716550fb8ffc9276ab5053b29bad7bb5c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 28 Nov 2004 00:39:58 +0000 Subject: [PATCH] New testcase for PR360 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18296 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CFrontend/2004-11-27-VariableSizeInStructure.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/CFrontend/2004-11-27-VariableSizeInStructure.c diff --git a/test/CFrontend/2004-11-27-VariableSizeInStructure.c b/test/CFrontend/2004-11-27-VariableSizeInStructure.c new file mode 100644 index 00000000000..bd63ae3b012 --- /dev/null +++ b/test/CFrontend/2004-11-27-VariableSizeInStructure.c @@ -0,0 +1,11 @@ +// RUN: %llvmgcc %s -S -o /dev/null + +// GCC allows variable sized arrays in structures, crazy! + +// This is PR360. + +int sub1(int i, char *pi) { + typedef int foo[i]; + struct bar {foo f1; int f2;} *p = (struct bar *) pi; + return p->f2; +}