aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-03-30 20:35:49 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2005-03-30 20:35:49 +0100
commit1e55c0e22a52b386c8d0791db024344b3cb35876 (patch)
tree2be5b945b2d43442ad7d484da300b889093ef64a /gcc/testsuite
parentc9d691e97774e863ea1b345b346f5d39ca88b645 (diff)
downloadgcc-1e55c0e22a52b386c8d0791db024344b3cb35876.zip
gcc-1e55c0e22a52b386c8d0791db024344b3cb35876.tar.gz
gcc-1e55c0e22a52b386c8d0791db024344b3cb35876.tar.bz2
re PR c/20368 (internal compiler error: tree check: expected function_type or method_type, have integer_type in start_function, at c-decl.c:5777)
PR c/20368 * c-decl.c (start_function): Check for old_decl being error_mark_node. testsuite: * gcc.dg/pr20368-1.c, gcc.dg/pr20368-2.c, gcc.dg/pr20368-3.c: New tests. From-SVN: r97270
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/pr20368-1.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr20368-2.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr20368-3.c12
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 991873c..be4633b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-30 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/20368
+ * gcc.dg/pr20368-1.c, gcc.dg/pr20368-2.c, gcc.dg/pr20368-3.c: New
+ tests.
+
2005-03-30 Alan Modra <amodra@bigpond.net.au>
* gcc.c-torture/compile/pr20203.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr20368-1.c b/gcc/testsuite/gcc.dg/pr20368-1.c
new file mode 100644
index 0000000..a88c7f8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr20368-1.c
@@ -0,0 +1,12 @@
+/* ICE with -Wstrict-prototypes and typeof an undeclared function.
+ Bug 20368. */
+/* { dg-do compile } */
+/* { dg-options "-Wstrict-prototypes" } */
+
+extern __typeof (f) g; /* { dg-error "error: 'f' undeclared here \\(not in a function\\)" } */
+
+int
+f (x)
+ float x;
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr20368-2.c b/gcc/testsuite/gcc.dg/pr20368-2.c
new file mode 100644
index 0000000..e3c8396
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr20368-2.c
@@ -0,0 +1,12 @@
+/* ICE with -Wstrict-prototypes and typeof an undeclared function.
+ Bug 20368. Test with -Wmissing-prototypes. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-prototypes" } */
+
+extern __typeof (f) g; /* { dg-error "error: 'f' undeclared here \\(not in a function\\)" } */
+
+int
+f (x)
+ float x;
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr20368-3.c b/gcc/testsuite/gcc.dg/pr20368-3.c
new file mode 100644
index 0000000..3209599
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr20368-3.c
@@ -0,0 +1,12 @@
+/* ICE with -Wstrict-prototypes and typeof an undeclared function.
+ Bug 20368. Test with -Wmissing-declarations. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-declarations" } */
+
+extern __typeof (f) g; /* { dg-error "error: 'f' undeclared here \\(not in a function\\)" } */
+
+int
+f (x)
+ float x;
+{
+}