From: Joseph Myers Date: Tue, 3 Aug 2004 14:19:39 +0000 (+0100) Subject: * gcc.dg/array-7.c, gcc.dg/c99-tag-2.c: New tests. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a1f75f1b77d03231fe926c754bfdec890541889;p=gcc.git * gcc.dg/array-7.c, gcc.dg/c99-tag-2.c: New tests. From-SVN: r85479 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ed388d8762..1ccb810df06 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-08-03 Joseph S. Myers + + * gcc.dg/array-7.c, gcc.dg/c99-tag-2.c: New tests. + 2004-08-03 Joseph S. Myers * gcc.dg/20001023-1.c, gcc.dg/20001108-1.c, gcc.dg/20001117-1.c, diff --git a/gcc/testsuite/gcc.dg/array-7.c b/gcc/testsuite/gcc.dg/array-7.c new file mode 100644 index 00000000000..b32d4ea03d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/array-7.c @@ -0,0 +1,14 @@ +/* Test for array of incomplete structure type - Zack Weinberg in + . */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct foo; + +void +f (void) +{ + struct foo { int a; int b; }; +} + +struct foo array[5]; /* { dg-error "storage size" } */ diff --git a/gcc/testsuite/gcc.dg/c99-tag-2.c b/gcc/testsuite/gcc.dg/c99-tag-2.c new file mode 100644 index 00000000000..22cf90e27d3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-tag-2.c @@ -0,0 +1,16 @@ +/* Test for handling of tags. A struct defined in an inner scope does + not match one declared in an outer scope. */ +/* Origin: Joseph Myers */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +struct s; +struct t { struct s *p; } x; + +void +f (void) +{ + /* This is a different struct s from the outer one. */ + struct s { int a; } y; + x.p = &y; /* { dg-error "incompatible" } */ +}