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]

[test] Avoid gratuitous io features


While nvptx doesn't have general io, it does manage to have 'printf'. The matrix and transpose tests were gratuitously failing because they had fprintf(stderr,...); fflush (...); The fflush is unneeded because it's followed by 'exit (0)', which flushes things, and the stderr is also unnecessary, stdout would be fine, (I think both are captured by dejagnu into one stream anyway, and failing at this point will truncate any expected output anyway).

This patch changes those tests to just use printf, and thus pass on nvptx. Other targets should be unaffected.

any objections?

nathan
2015-08-24  Nathan Sidwell  <nathan@acm.org>

	* gcc/testsuite/gcc.dg/torture/matrix-1.c: Use plain printf.
	* gcc/testsuite/gcc.dg/torture/matrix-2.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/matrix-5.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/matrix-6.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/transpose-1.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/transpose-2.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/transpose-3.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/transpose-4.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/transpose-5.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/transpose-6.c: Likewise.

Index: gcc/testsuite/gcc.dg/torture/transpose-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/transpose-1.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/transpose-1.c	(working copy)
@@ -69,8 +69,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/matrix-5.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/matrix-5.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/matrix-5.c	(working copy)
@@ -67,8 +67,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/transpose-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/transpose-2.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/transpose-2.c	(working copy)
@@ -66,8 +66,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/matrix-6.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/matrix-6.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/matrix-6.c	(working copy)
@@ -68,8 +68,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/transpose-3.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/transpose-3.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/transpose-3.c	(working copy)
@@ -71,8 +71,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/transpose-4.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/transpose-4.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/transpose-4.c	(working copy)
@@ -69,8 +69,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/transpose-5.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/transpose-5.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/transpose-5.c	(working copy)
@@ -66,8 +66,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/transpose-6.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/transpose-6.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/transpose-6.c	(working copy)
@@ -66,8 +66,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/matrix-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/matrix-1.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/matrix-1.c	(working copy)
@@ -62,8 +62,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }
Index: gcc/testsuite/gcc.dg/torture/matrix-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/matrix-2.c	(revision 227123)
+++ gcc/testsuite/gcc.dg/torture/matrix-2.c	(working copy)
@@ -73,8 +73,7 @@ mem_init (void)
       vel[i] = (int **) malloc (3 * sizeof (int *));
       if (vel[i] == (int **) NULL)
 	{
-	  fprintf (stderr, "malloc failed for vel[%d]\n", i);
-	  fflush (stderr);
+	  printf ("malloc failed for vel[%d]\n", i);
 	  exit (0);
 	}
     }

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