aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/array-4.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-01-04 21:56:00 -0800
committerRichard Henderson <rth@gcc.gnu.org>2001-01-04 21:56:00 -0800
commit00de56c7d0e654b52c23e789dbe3cc32d361a527 (patch)
treeb4606c69a6e503b36bcef04bc2f8a017f8bd95f6 /gcc/testsuite/gcc.dg/array-4.c
parent69f6e760a80eef94fa88119e4f2ac4c63353dc78 (diff)
downloadgcc-00de56c7d0e654b52c23e789dbe3cc32d361a527.zip
gcc-00de56c7d0e654b52c23e789dbe3cc32d361a527.tar.gz
gcc-00de56c7d0e654b52c23e789dbe3cc32d361a527.tar.bz2
20000926-1.c: Update expected warnings.
* gcc.dg/20000926-1.c: Update expected warnings. * gcc.dg/array-2.c: Likewise. * gcc.dg/array-4.c: Also validate flexible array members. * gcc.dg/c99-flex-array-1.c: New. From-SVN: r38704
Diffstat (limited to 'gcc/testsuite/gcc.dg/array-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/array-4.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/array-4.c b/gcc/testsuite/gcc.dg/array-4.c
index 9396dec..52ad921 100644
--- a/gcc/testsuite/gcc.dg/array-4.c
+++ b/gcc/testsuite/gcc.dg/array-4.c
@@ -1,13 +1,19 @@
/* { dg-do run } */
/* { dg-options "" } */
-/* Verify that GCC's extension to initialize a zero-length array
- member works properly. */
+/* Verify that GCC's initialized flexible array member extension
+ works properly. */
extern void abort(void);
extern void exit(int);
-struct f { int w; int x[0]; } f = { 4, { 0, 1, 2, 3 } };
+struct f { int w; int x[]; };
+struct g { int w; int x[0]; };
+
+static struct f f = { 4, { 0, 1, 2, 3 } };
+static int junk1[] = { -1, -1, -1, -1 };
+static struct g g = { 4, { 0, 1, 2, 3 } }; /* { dg-warning "(deprecated initialization)|(near initialization)" "" } */
+static int junk2[] = { -1, -1, -1, -1 };
int main()
{
@@ -15,5 +21,8 @@ int main()
for (i = 0; i < f.w; ++i)
if (f.x[i] != i)
abort ();
+ for (i = 0; i < g.w; ++i)
+ if (g.x[i] != i)
+ abort ();
exit(0);
}