aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/array-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/array-3.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-3.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-3.c
new file mode 100644
index 000000000..f0709d220
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* ISO C99 flexible array members don't have a size. GCC's zero-length
+ array extension does. */
+
+struct f { int w; int x[0]; } f;
+struct g { int w; int x[]; } g;
+
+char test_gcc[sizeof (f.x) ? -1 : 1];
+char test_iso[sizeof (g.x) ? -1 : 1]; /* { dg-error "incomplete type" "iso" } */