This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Testcases update for new C parser, batch 1


This patch is a first batch of fixes to testcases to allow for the new C 
parser.  This batch changes testcases which expect "parse error" or 
"syntax error" to allow for "expected" as well, for various tests for 
which this is sufficient to make them pass for the new parser.  As such 
the tests still pass with the old parser, so I've applied this patch to 
mainline.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

2004-11-04  Joseph S. Myers  <joseph@codesourcery.com>

	* gcc.dg/c90-restrict-1.c, gcc.dg/c99-arraydecl-2.c,
	gcc.dg/c99-func-2.c, gcc.dg/charset/asm2.c, gcc.dg/concat.c,
	gcc.dg/cpp/19990413-1.c, gcc.dg/cpp/paste4.c,
	gcc.dg/init-desig-obs-1.c, gcc.dg/noncompile/920721-2.c,
	gcc.dg/noncompile/930622-2.c, gcc.dg/noncompile/940112-1.c,
	gcc.dg/noncompile/950921-1.c, gcc.dg/switch-2.c,
	objc.dg/naming-1.m, objc.dg/naming-2.m: Adjust expected messages
	for new parser.

diff -rupN GCC.orig/gcc/testsuite/gcc.dg/c90-restrict-1.c GCC/gcc/testsuite/gcc.dg/c90-restrict-1.c
--- GCC.orig/gcc/testsuite/gcc.dg/c90-restrict-1.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/c90-restrict-1.c	2004-11-02 17:13:37.000000000 +0000
@@ -4,4 +4,4 @@
 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
 
 char *restrict foo; /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "(parse|syntax) error|no type" "restrict not in C90" { target *-*-* } 6 } */
+/* { dg-error "parse error|syntax error|expected|no type" "restrict not in C90" { target *-*-* } 6 } */
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/c99-arraydecl-2.c GCC/gcc/testsuite/gcc.dg/c99-arraydecl-2.c
--- GCC.orig/gcc/testsuite/gcc.dg/c99-arraydecl-2.c	2003-10-24 15:27:37.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/c99-arraydecl-2.c	2004-11-02 17:13:56.000000000 +0000
@@ -7,10 +7,10 @@
 void
 foo (void)
 {
-  int a[2, 3]; /* { dg-error "parse|syntax" "bad array declarator" } */
-  void b(int x[2, 3]); /* { dg-error "parse|syntax" "bad array declarator" } */
-  void c(int [2, 3]); /* { dg-error "parse|syntax" "bad array declarator" } */
-  void d(int *x[restrict 2, 3]); /* { dg-error "parse|syntax" "bad array declarator" } */
-  void e(int *x[static restrict 2, 3]); /* { dg-error "parse|syntax" "bad array declarator" } */
-  void f(int *x[restrict static 2, 3]); /* { dg-error "parse|syntax" "bad array declarator" } */
+  int a[2, 3]; /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+  void b(int x[2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+  void c(int [2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+  void d(int *x[restrict 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+  void e(int *x[static restrict 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+  void f(int *x[restrict static 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
 }
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/c99-func-2.c GCC/gcc/testsuite/gcc.dg/c99-func-2.c
--- GCC.orig/gcc/testsuite/gcc.dg/c99-func-2.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/c99-func-2.c	2004-11-02 17:23:55.000000000 +0000
@@ -6,5 +6,5 @@
 void
 foo (void)
 {
-  __func__ "foo"; /* { dg-error "(parse|syntax) error" "before string constant" } */
+  __func__ "foo"; /* { dg-error "parse error|syntax error|expected" "before string constant" } */
 }
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/charset/asm2.c GCC/gcc/testsuite/gcc.dg/charset/asm2.c
--- GCC.orig/gcc/testsuite/gcc.dg/charset/asm2.c	2004-03-22 09:48:38.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/charset/asm2.c	2004-11-02 17:15:44.000000000 +0000
@@ -3,13 +3,13 @@
    the string "foobar" should be translated.  */
 /* { dg-do compile } */
 /* { dg-require-iconv "IBM-1047" } */
-asm (not_a_string); /* { dg-error "(parse|syntax) error before" "not_a_string" } */
+asm (not_a_string); /* { dg-error "(parse error|syntax error|expected string literal) before" "not_a_string" } */
 char x[] = "foobar";
 
 void foo (void)
 {
   char *y;
-  asm (not_a_string2); /* { dg-error "(parse|syntax) error before" "not_a_string" } */
+  asm (not_a_string2); /* { dg-error "(parse error|syntax error|expected string literal) before" "not_a_string" } */
 
 #define FOO "walrus"
   y = FOO;
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/concat.c GCC/gcc/testsuite/gcc.dg/concat.c
--- GCC.orig/gcc/testsuite/gcc.dg/concat.c	2003-10-04 07:36:35.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/concat.c	2004-11-02 17:14:12.000000000 +0000
@@ -8,9 +8,9 @@
 
 void foo ()
 {
-  char s1[] = __FUNCTION__".";	     /* { dg-error "(parse|syntax|invalid)" } */
-  char s2[] = __PRETTY_FUNCTION__".";/* { dg-error "(parse|syntax|invalid)" } */
-  char s3[] = "."__FUNCTION__;	     /* { dg-error "(parse|syntax|invalid)" } */
-  char s4[] = "."__PRETTY_FUNCTION__;/* { dg-error "(parse|syntax|invalid)" } */
+  char s1[] = __FUNCTION__".";	     /* { dg-error "(parse|syntax|expected|invalid)" } */
+  char s2[] = __PRETTY_FUNCTION__".";/* { dg-error "(parse|syntax|expected|invalid)" } */
+  char s3[] = "."__FUNCTION__;	     /* { dg-error "(parse|syntax|expected|invalid)" } */
+  char s4[] = "."__PRETTY_FUNCTION__;/* { dg-error "(parse|syntax|expected|invalid)" } */
   char s5[] = "."".";                /* No error.  */
 }
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/cpp/19990413-1.c GCC/gcc/testsuite/gcc.dg/cpp/19990413-1.c
--- GCC.orig/gcc/testsuite/gcc.dg/cpp/19990413-1.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/cpp/19990413-1.c	2004-11-02 17:16:12.000000000 +0000
@@ -9,5 +9,5 @@ func(void)
 {
   FOO(i
       = 4)
-  else;  /* { dg-error "(parse|syntax) error" "error on this line" { target *-*-* } { 12 } } */ 
+  else;  /* { dg-error "parse error|syntax error|expected" "error on this line" { target *-*-* } { 12 } } */ 
 }
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/cpp/paste4.c GCC/gcc/testsuite/gcc.dg/cpp/paste4.c
--- GCC.orig/gcc/testsuite/gcc.dg/cpp/paste4.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/cpp/paste4.c	2004-11-02 17:17:05.000000000 +0000
@@ -11,6 +11,6 @@
 
 int main ()
 {
-  double d = glue (1.0e, +1); /* { dg-error "exponent|(parse|syntax) error" } */
+  double d = glue (1.0e, +1); /* { dg-error "exponent|parse error|syntax error|expected" } */
   return 0;
 }
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/init-desig-obs-1.c GCC/gcc/testsuite/gcc.dg/init-desig-obs-1.c
--- GCC.orig/gcc/testsuite/gcc.dg/init-desig-obs-1.c	2004-10-25 22:20:14.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/init-desig-obs-1.c	2004-11-02 17:14:42.000000000 +0000
@@ -12,8 +12,8 @@ int x0[] = { [0] = 1 };
 int x1[] = { [0] 1 };
 
 /* Invalid syntax: multiple designators without "=".  */
-int x2[2][2] = { [0][0] 1 }; /* { dg-error "(syntax|parse) error" } */
+int x2[2][2] = { [0][0] 1 }; /* { dg-error "syntax error|parse error|expected" } */
 
 
 /* Invalid syntax: C99-style structure designator without "=".  */
-struct s s2 = { .a 1 }; /* { dg-error "(syntax|parse) error" } */
+struct s s2 = { .a 1 }; /* { dg-error "syntax error|parse error|expected" } */
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/noncompile/920721-2.c GCC/gcc/testsuite/gcc.dg/noncompile/920721-2.c
--- GCC.orig/gcc/testsuite/gcc.dg/noncompile/920721-2.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/noncompile/920721-2.c	2004-11-02 17:19:42.000000000 +0000
@@ -2,5 +2,5 @@ void f(int n)
 {
 int s;
 for(s=0;s<n;s++)
-  s==5?1 n=1;		/* { dg-error "(parse|syntax) error" } */
+  s==5?1 n=1;		/* { dg-error "parse error|syntax error|expected" } */
 }
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/noncompile/930622-2.c GCC/gcc/testsuite/gcc.dg/noncompile/930622-2.c
--- GCC.orig/gcc/testsuite/gcc.dg/noncompile/930622-2.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/noncompile/930622-2.c	2004-11-02 17:20:50.000000000 +0000
@@ -1,6 +1,6 @@
 f ()
 {
   int i;
-  for (i--)	/* { dg-error "parse|syntax" } */
+  for (i--)	/* { dg-error "parse|syntax|expected" } */
     ;
 }
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/noncompile/940112-1.c GCC/gcc/testsuite/gcc.dg/noncompile/940112-1.c
--- GCC.orig/gcc/testsuite/gcc.dg/noncompile/940112-1.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/noncompile/940112-1.c	2004-11-02 17:21:01.000000000 +0000
@@ -4,4 +4,4 @@ f (int x)
   double e = 1;
   e = 1;
   return (e)
-}	/* { dg-error "(parse|syntax) error" } */
+}	/* { dg-error "parse error|syntax error|expected" } */
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/noncompile/950921-1.c GCC/gcc/testsuite/gcc.dg/noncompile/950921-1.c
--- GCC.orig/gcc/testsuite/gcc.dg/noncompile/950921-1.c	2003-02-04 00:27:55.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/noncompile/950921-1.c	2004-11-02 17:21:20.000000000 +0000
@@ -1,10 +1,10 @@
 typedef enum
 {
-  a = (X) 0,	/* { dg-error "undeclared|not integer|(parse|syntax) error" } */
+  a = (X) 0,	/* { dg-error "undeclared|not integer|parse error|syntax error|expected" } */
   b
 } c;
 
 typedef enum
 {
-  d = (X) 0	/* { dg-error "undeclared|not integer|(parse|syntax) error" } */
+  d = (X) 0	/* { dg-error "undeclared|not integer|parse error|syntax error|expected" } */
 } e;
diff -rupN GCC.orig/gcc/testsuite/gcc.dg/switch-2.c GCC/gcc/testsuite/gcc.dg/switch-2.c
--- GCC.orig/gcc/testsuite/gcc.dg/switch-2.c	2003-03-04 11:06:32.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/switch-2.c	2004-11-02 17:14:55.000000000 +0000
@@ -7,4 +7,4 @@ int foo(int i)
   switch (i)
     case 3:
       return 1,
-}  /* { dg-error "(parse|syntax) error" } */
+}  /* { dg-error "parse error|syntax error|expected" } */
diff -rupN GCC.orig/gcc/testsuite/objc.dg/naming-1.m GCC/gcc/testsuite/objc.dg/naming-1.m
--- GCC.orig/gcc/testsuite/objc.dg/naming-1.m	2004-03-24 10:50:45.000000000 +0000
+++ GCC/gcc/testsuite/objc.dg/naming-1.m	2004-11-03 22:27:16.000000000 +0000
@@ -15,5 +15,5 @@ void foo(void)
 void bar(void)
 {
 	View *view;	/* ok */
-	View = 1;	/* { dg-error "(parse|syntax) error" } */
+	View = 1;	/* { dg-error "parse error|syntax error|expected" } */
 }
diff -rupN GCC.orig/gcc/testsuite/objc.dg/naming-2.m GCC/gcc/testsuite/objc.dg/naming-2.m
--- GCC.orig/gcc/testsuite/objc.dg/naming-2.m	2003-03-23 18:46:42.000000000 +0000
+++ GCC/gcc/testsuite/objc.dg/naming-2.m	2004-11-03 22:27:46.000000000 +0000
@@ -4,7 +4,7 @@
 
 @interface Foo
 @end
-float Foo;  /* { dg-error "(parse|syntax) error" } */
+float Foo;  /* { dg-error "parse error|syntax error|expected" } */
 
 double Bar;
 @interface Bar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]