From: Kaveh R. Ghazi Date: Sun, 8 Oct 2006 05:31:15 +0000 (+0000) Subject: builtins-config.h: Ensure we use -std=c99 on solaris2. X-Git-Tag: releases/gcc-4.0.4~306 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6bc893b9a01f0d2758855cd6db1efd1d803a196;p=thirdparty%2Fgcc.git builtins-config.h: Ensure we use -std=c99 on solaris2. * 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 * 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. From-SVN: r117551 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ae67d4a4db7..d13c18e03f45 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,21 @@ +2006-10-08 Kaveh R. Ghazi + + * 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 + + * 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. + 2006-09-21 Steven Bosscher PR middle-end/26983 diff --git a/gcc/testsuite/gcc.dg/builtins-18.c b/gcc/testsuite/gcc.dg/builtins-18.c index a47de8b609ee..3a3872d18051 100644 --- a/gcc/testsuite/gcc.dg/builtins-18.c +++ b/gcc/testsuite/gcc.dg/builtins-18.c @@ -7,6 +7,7 @@ /* { dg-do link } */ /* { dg-options "-O2 -ffast-math" } */ +/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */ #include "builtins-config.h" @@ -32,9 +33,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. */ @@ -43,9 +44,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. */ @@ -54,9 +55,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 --git a/gcc/testsuite/gcc.dg/builtins-20.c b/gcc/testsuite/gcc.dg/builtins-20.c index fb7dd95c84b9..a41e00e40bcd 100644 --- a/gcc/testsuite/gcc.dg/builtins-20.c +++ b/gcc/testsuite/gcc.dg/builtins-20.c @@ -7,6 +7,7 @@ /* { dg-do link } */ /* { dg-options "-O2 -ffast-math" } */ +/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */ #include "builtins-config.h" diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h index 05afc5ee567f..873e638c9a18 100644 --- a/gcc/testsuite/gcc.dg/builtins-config.h +++ b/gcc/testsuite/gcc.dg/builtins-config.h @@ -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 --git a/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c b/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c index ac671590d204..5e77c49e81cc 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c @@ -7,6 +7,7 @@ /* { dg-do link } */ /* { dg-options "-ffast-math" } */ +/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */ #include "../builtins-config.h" diff --git a/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c b/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c index 68fc071eb7dd..03175f4a68d3 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c @@ -7,6 +7,7 @@ /* { dg-do link } */ /* { dg-options "-ffast-math" } */ +/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */ #include "../builtins-config.h" diff --git a/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c b/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c index 9901ceccf819..0773a01c9b7f 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c @@ -7,6 +7,7 @@ /* { dg-do link } */ /* { dg-options "-ffast-math" } */ +/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */ #include "../builtins-config.h" diff --git a/gcc/testsuite/gcc.dg/torture/builtin-power-1.c b/gcc/testsuite/gcc.dg/torture/builtin-power-1.c index 7cdc00c23fb0..ede5d9c60d87 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-power-1.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-power-1.c @@ -7,6 +7,7 @@ /* { dg-do link } */ /* { dg-options "-ffast-math" } */ +/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */ #include "../builtins-config.h"