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]

[PATCH] gcc.dg/noncompile/ cleanup


This patch is a cleanup of tests in gcc.dg/noncompile/ directory.
See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info.

Tested on x86_64-linux: vanilla results == results with this patch ==
results with this patch and gnu11 as a default.

Ok?

2014-10-02  Marek Polacek  <polacek@redhat.com>

	* gcc.dg/noncompile/20020130-1.c: Use -std=gnu89.
	* gcc.dg/noncompile/20050120-1.c: Likewise.
	* gcc.dg/noncompile/old-style-parm-2.c: Likewise.
	* gcc.dg/noncompile/920616-2.c: Fix defaulting to int.
	* gcc.dg/noncompile/930301-1.c: Likewise.
	* gcc.dg/noncompile/930622-1.c: Likewise.
	* gcc.dg/noncompile/930622-2.c: Likewise.
	* gcc.dg/noncompile/950825-1.c: Likewise.
	* gcc.dg/noncompile/invalid_asm.c: Likewise.
	* gcc.dg/noncompile/scope.c: Likewise.
	* gcc.dg/noncompile/va-arg-1.c: Likewise.
	* gcc.dg/noncompile/920923-1.c: Fix implicit declarations.
	* gcc.dg/noncompile/971104-1.c: Likewise.

diff --git gcc/gcc/testsuite/gcc.dg/noncompile/20020130-1.c gcc/gcc/testsuite/gcc.dg/noncompile/20020130-1.c
index d820e06..61669b9 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/20020130-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/20020130-1.c
@@ -1,5 +1,6 @@
 /* Test for ICE when using typedef for bad type.  */
 /* Origin: Joseph Myers <jsm28@cam.ac.uk>.  */
+/* { dg-options "-std=gnu89" } */
 
 void
 foo (void)
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/20050120-1.c gcc/gcc/testsuite/gcc.dg/noncompile/20050120-1.c
index 4af84b6..7d8f7fa 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/20050120-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/20050120-1.c
@@ -1,6 +1,6 @@
 /* PR c/18946 */
 /* { dg-do compile } */
-/* { dg-options "-Wshadow" } */
+/* { dg-options "-Wshadow -std=gnu89" } */
 
 void bar (void)
 {
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/920616-2.c gcc/gcc/testsuite/gcc.dg/noncompile/920616-2.c
index 25f5943..e43d009 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/920616-2.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/920616-2.c
@@ -1 +1 @@
-f(void a,...){}		/* { dg-error "has incomplete type" } */
+void f(void a,...){}		/* { dg-error "has incomplete type" } */
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/920923-1.c gcc/gcc/testsuite/gcc.dg/noncompile/920923-1.c
index ccd1dc3..1cb140e 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/920923-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/920923-1.c
@@ -22,6 +22,12 @@ struct PTP {
 typedef struct PTP (u.p_tablep);/* { dg-error "expected" } */
 int pfree=0;
 int pcount=0;
+int Level1 ();
+int Level2 ();
+void enlarge_hash_table ();
+int fill_item_entry ();
+int __eprintf ();
+void build_ptables ();
 
 void
 mmu_walk_find(va)
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/930301-1.c gcc/gcc/testsuite/gcc.dg/noncompile/930301-1.c
index afabd15..b36f00f 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/930301-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/930301-1.c
@@ -1,4 +1,5 @@
 struct a *q;
+void
 f()
 {
   q++;	/* { dg-error "pointer to" } */
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/930622-1.c gcc/gcc/testsuite/gcc.dg/noncompile/930622-1.c
index 835e072..93567a9 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/930622-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/930622-1.c
@@ -1,3 +1,4 @@
+void
 f ()
 {
   double b;
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/930622-2.c gcc/gcc/testsuite/gcc.dg/noncompile/930622-2.c
index 5e02d89..f289bf8 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/930622-2.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/930622-2.c
@@ -1,3 +1,4 @@
+void
 f ()
 {
   int i;
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/950825-1.c gcc/gcc/testsuite/gcc.dg/noncompile/950825-1.c
index 43dca2f..4e3d6fb 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/950825-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/950825-1.c
@@ -1,3 +1,4 @@
+int
 main()
 {
 return (struct x) {{y: 0}};   /* { dg-error "extra|near|excess|incompatible|invalid" } */
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/971104-1.c gcc/gcc/testsuite/gcc.dg/noncompile/971104-1.c
index 722b71c..39e00c6 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/971104-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/971104-1.c
@@ -14,6 +14,9 @@ union semun {
 };
 static union semun semctl_arg;
 static int semid;
+int semop(int semid, struct sembuf *sops, unsigned nsops);
+void error (const char *);
+int semctl(int semid, int semnum, int cmd, ...);
 static void up(int sem){
   struct sembuf sb;
   sb.sem_num = (unsigned short) sem;
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c gcc/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c
index d1d4b36..fdb0296 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c
@@ -1,4 +1,5 @@
 /* { dg-options "-ffat-lto-objects" } */
+void
 asm_invalid_register_name()
 {
   asm("":::"this_is_an_invalid_register_name");	/* { dg-error "unknown register" } */
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c gcc/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c
index 1b156b7..f481f4a 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c
@@ -2,7 +2,7 @@
    parameters is not accepted.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu89" } */
 
 void
 f(a)
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/scope.c gcc/gcc/testsuite/gcc.dg/noncompile/scope.c
index 7f09c27..67e136f 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/scope.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/scope.c
@@ -2,6 +2,7 @@ extern void abort (void);
 extern void exit (int);
 static int v = 3;
 
+void
 f ()
 {
   int v = 4;
@@ -12,6 +13,7 @@ f ()
   }
 }
 
+int
 main ()
 {
   f ();
diff --git gcc/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c gcc/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
index b8b7d3c..f36a492 100644
--- gcc/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
+++ gcc/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
@@ -1,5 +1,6 @@
 #include <stdarg.h>
 
+void
 f (int x, ...)
 {
   va_list args;

	Marek


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