This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA:] fix lack of #ifdef HAVE_C99_RUNTIME in builtins-20.c and elsewhere
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: gcc-patches at gcc dot gnu dot org, roger at eyesopen dot com
- Date: Mon, 19 Mar 2007 13:09:13 -0400 (EDT)
- Subject: Re: [RFA:] fix lack of #ifdef HAVE_C99_RUNTIME in builtins-20.c and elsewhere
- References: <200703181222.l2ICMFEq004050@ignucius.se.axis.com>
On Sun, 18 Mar 2007, Hans-Peter Nilsson wrote:
> * gcc.dg/builtins-59.c, gcc.dg/builtins-61.c,
> gcc.dg/builtins-62.c: Require c99_math.
> * gcc.dg/builtins-20.c (test3f, test3l): Wrap cargf, cargl, atan2f
> and atan2l test in #ifdef HAVE_C99_RUNTIME.
> * lib/target-supports.exp (check_effective_target_c99_math): New.
> +# Return 1 if the target has c99 math functions as implied by
> +# the target macro TARGET_C99_FUNCTIONS.
> +
> +proc check_effective_target_c99_math { } {
> + global srcdir
> + return [check_no_compiler_messages c99_math assembly {
> + #include "builtins-config.h"
> + #ifndef HAVE_C99_RUNTIME
> + #error "No HAVE_C99_RUNTIME"
> + #endif
> + } -I$srcdir/gcc.dg ]
> +}
I'm not sure this bit is right. Certain targets (solaris, darwin?)
require special flags to compile builtins-config.h cleanly and activate
C99 mode. With your test, they will fail this check and bypass any test
marked with c99_math.
Is there a way to just use the existing idiom in all the tests by wrapping
the offending code with HAVE_C99_RUNTIME and avoid the new "target
supports" check?
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu