New testcase for c-parse.in
Neil Booth
neil@daikokuya.demon.co.uk
Tue Feb 12 03:51:00 GMT 2002
I (half-deliberately) broke c-parse.in to see if there was a testcase
for something, and there wasn't. Since this is the cause of some
complicated duplication in c-parse.in it should have a test case.
This tests a single paragraph of the standard. I wonder if it would be
a good idea to start a new directory, in which there is an attempt to
test all paragraphs of the standard? Each tests case could be named
after its paragraph (possibly with -n suffixes), and any tests from
the rest of the testsuite moved there. I tend to think it's a
good idea 8-)
Neil.
* gcc.dg/decl-1.c: New test.
Index: decl-1.c
===================================================================
RCS file: decl-1.c
diff -N decl-1.c
--- /dev/null Tue May 5 13:32:27 1998
+++ decl-1.c Mon Feb 11 23:36:02 2002
@@ -0,0 +1,15 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+
+ Source: Neil Booth, 12 Feb 2002.
+
+ In the declaration of proc, x must be parsed as a typedef name
+ (6.7.5.3 p11). */
+
+typedef int x;
+int proc(int (x)); /* x is a typedef, param to proc is a function. */
+int proc2(int x); /* x is an identifier, param is an int. */
+
+int main ()
+{
+ return proc (proc2); /* { dg-bogus "integer from pointer" } */
+}
More information about the Gcc-patches
mailing list