summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-03 14:19:39 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-03 14:19:39 +0000
commit5cd9021030cf3325522575b0bdb3e1dbb923a7f3 (patch)
tree5d5604cd34e940508d3efdd8292f60d7a37574eb
parent896a8c9e4ae5ce9249e610914b42d7f4c85f387b (diff)
downloadgcc-5cd9021030cf3325522575b0bdb3e1dbb923a7f3.tar.gz
* gcc.dg/array-7.c, gcc.dg/c99-tag-2.c: New tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85479 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/array-7.c14
-rw-r--r--gcc/testsuite/gcc.dg/c99-tag-2.c16
3 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2ed388d8762..1ccb810df06 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2004-08-03 Joseph S. Myers <jsm@polyomino.org.uk>
+ * gcc.dg/array-7.c, gcc.dg/c99-tag-2.c: New tests.
+
+2004-08-03 Joseph S. Myers <jsm@polyomino.org.uk>
+
* gcc.dg/20001023-1.c, gcc.dg/20001108-1.c, gcc.dg/20001117-1.c,
gcc.dg/20010202-1.c, gcc.dg/20011008-2.c, gcc.dg/20011214-1.c,
gcc.dg/20020201-1.c, gcc.dg/20020312-2.c, gcc.dg/20020426-2.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
+ <http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00108.html>. */
+/* { 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 <jsm@polyomino.org.uk> */
+/* { 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" } */
+}