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]

[4.1 patch installed] Run more c99 tests on solaris 10


This is the 4.1 version of my previous patch.  I had to backport an
additional testsuite bit from mainline.  Also, the builtins-18.c test was
getting warnings because it used the unprototyped link_failure() when
-std=c99 was added.  So I switched to link_error() which is what is
prototyped and is what is used on mainline.

Tested on sparc-sun-solaris2.10 with a c-only "make check" and installed
as "obvious".

		--Kaveh


2006-10-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gcc.dg/builtins-config.h: Ensure we use -std=c99 on solaris2.
	* gcc.dg/torture/builtin-convert-1.c,
	gcc.dg/torture/builtin-convert-2.c,
	gcc.dg/torture/builtin-convert-3.c,
	gcc.dg/torture/builtin-power-1.c: Use -std=c99 on solaris2.
	* gcc.dg/builtins-18.c: Always use link_error(), which is
	prototyped.

	Backport:
	2006-03-21  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* gcc.dg/builtins-config.h (Solaris case): Define HAVE_C99_RUNTIME
	if _STDC_C99 is defined.
	* gcc.dg/builtins-18.c: Pass -std=c99 on Solaris.
	* gcc.dg/builtins-20.c: Likewise.
	* gcc.dg/builtins-53.c: Likewise.

diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-18.c egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-18.c
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-18.c	2006-01-22 23:57:33.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-18.c	2006-10-08 00:00:01.714017879 -0400
@@ -8,6 +8,7 @@
 /* { dg-do link } */
 /* { dg-options "-O2 -ffast-math" } */
 /* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */

 #include "builtins-config.h"

@@ -33,9 +34,9 @@ main (void)
   if (__builtin_cabsf (fc) != 5.0F)
     link_error ();
   if (cabsf (3.0F + 4.0iF) != 5.0F)
-    link_failure ();
+    link_error ();
   if (__builtin_cabsf (3.0F + 4.0iF) != 5.0F)
-    link_failure ();
+    link_error ();
 #endif

   /* Test doubles.  */
@@ -44,9 +45,9 @@ main (void)
   if (__builtin_cabs (dc) != 5.0)
     link_error ();
   if (cabs (3.0 + 4.0i) != 5.0)
-    link_failure ();
+    link_error ();
   if (__builtin_cabs (3.0 + 4.0i) != 5.0)
-    link_failure ();
+    link_error ();

 #ifdef HAVE_C99_RUNTIME
   /* Test long doubles.  */
@@ -55,9 +56,9 @@ main (void)
   if (__builtin_cabsl (ldc) != 5.0L)
     link_error ();
   if (cabsl (3.0L + 4.0iL) != 5.0L)
-    link_failure ();
+    link_error ();
   if (__builtin_cabsl (3.0L + 4.0iL) != 5.0L)
-    link_failure ();
+    link_error ();
 #endif

   return 0;
diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-20.c egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-20.c
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-20.c	2006-01-22 23:57:47.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-20.c	2006-10-07 20:59:01.641299736 -0400
@@ -8,6 +8,7 @@
 /* { dg-do link } */
 /* { dg-options "-O2 -ffast-math" } */
 /* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */

 #include "builtins-config.h"

diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-53.c egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-53.c
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-53.c	2006-01-22 23:57:06.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-53.c	2006-10-07 20:59:01.642008307 -0400
@@ -11,6 +11,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -ffast-math" } */
 /* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */

 #include "builtins-config.h"

diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-config.h egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-config.h
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-config.h	2006-01-22 23:57:04.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/builtins-config.h	2006-10-07 20:59:01.642719678 -0400
@@ -11,8 +11,15 @@

 #if defined(__hppa) && defined(__hpux)
 /* PA HP-UX doesn't have the entire C99 runtime.  */
-#elif defined(__sun)
-/* Solaris doesn't have the entire C99 runtime.  */
+#elif defined(__sun) && __STDC_VERSION__ - 0 < 199901L
+/* Solaris up to 9 doesn't have the entire C99 runtime.
+   Solaris 10 defines _STDC_C99 if __STDC_VERSION__ is >= 199901L.
+   But, if you're including this file, you probably want to test the
+   newer behaviour, so: */
+#error forgot to set -std=c99.
+#elif defined(__sun) && ! defined (_STDC_C99)
+/* Solaris up to 9 doesn't have the entire C99 runtime.
+   Solaris 10 defines _STDC_C99 if __STDC_VERSION__ is >= 199901L.  */
 #elif defined(__sgi)
 /* Irix6 doesn't have the entire C99 runtime.  */
 #elif defined(__FreeBSD__) && (__FreeBSD__ < 5)
diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c	2006-01-22 23:53:18.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c	2006-10-07 20:59:01.643518810 -0400
@@ -8,6 +8,7 @@
 /* { dg-do link } */
 /* { dg-options "-ffast-math" } */
 /* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */

 #include "../builtins-config.h"

diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c	2006-01-22 23:53:18.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c	2006-10-07 20:59:01.644218261 -0400
@@ -8,6 +8,7 @@
 /* { dg-do link } */
 /* { dg-options "-ffast-math" } */
 /* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */

 #include "../builtins-config.h"

diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c	2006-01-22 23:53:18.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c	2006-10-07 20:59:01.644869230 -0400
@@ -8,6 +8,7 @@
 /* { dg-do link } */
 /* { dg-options "-ffast-math" } */
 /* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */

 #include "../builtins-config.h"

diff -rup orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-power-1.c egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-power-1.c
--- orig/egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-power-1.c	2006-01-22 23:53:15.000000000 -0500
+++ egcc-4.1-SVN20061006/gcc/testsuite/gcc.dg/torture/builtin-power-1.c	2006-10-07 20:59:01.645547081 -0400
@@ -8,6 +8,7 @@
 /* { dg-do link } */
 /* { dg-options "-ffast-math" } */
 /* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */

 #include "../builtins-config.h"


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