Test handling of structs with multiple variable-sized fields.
authorDuncan Sands <baldrick@free.fr>
Tue, 20 Mar 2007 14:13:20 +0000 (14:13 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 20 Mar 2007 14:13:20 +0000 (14:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35212 91177308-0d34-0410-b5e6-96231b3b80d8

test/CFrontend/2007-03-06-VarSizeInStruct1.c [new file with mode: 0644]
test/CFrontend/2007-03-06-VarSizeInStruct2.c [new file with mode: 0644]

diff --git a/test/CFrontend/2007-03-06-VarSizeInStruct1.c b/test/CFrontend/2007-03-06-VarSizeInStruct1.c
new file mode 100644 (file)
index 0000000..8d28a1d
--- /dev/null
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -S -o -
+void* p (int n) {
+  struct f {
+    char w; char x[n]; char z[];
+  } F;
+  F.x[0]='x';
+  return &F;
+}
diff --git a/test/CFrontend/2007-03-06-VarSizeInStruct2.c b/test/CFrontend/2007-03-06-VarSizeInStruct2.c
new file mode 100644 (file)
index 0000000..13bc3aa
--- /dev/null
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -S -o -
+char p (int n) {
+  struct f {
+    char w; char x[n]; char y[n];
+  } F;
+
+  return F.x[0];
+}