Looking at UNSUPPORTED dejagnu tests for a port...
Jonathan Wakely
jwakely.gcc@gmail.com
Tue Mar 30 19:35:10 GMT 2021
On Tue, 30 Mar 2021 at 20:23, Alan Lehotsky <alehotsky@codegentllc.com> wrote:
>
> I’m doing some final polishing on a gcc 8.3 upgrade and taking a look at the unsupported tests. Most of them are completely sensible (my port doesn’t support trampolines, for example). But gcc.c-torture/execute/pr78622.c is marked as unsupported. That appears to be due to the line
>
> { dg-require-effective-target c99_runtime }
>
> I’m using newlib, and if I manually compile the test case with or without an explicit —std=c99, it compiles and links without error.
> Do I need to set something in the baseboards file or in a local .exp file to indicate that c99 is okay?
That effective-target is defined by this check:
# Return 1 if the target provides a full C99 runtime.
proc check_effective_target_c99_runtime { } {
return [check_cached_effective_target c99_runtime {
global srcdir
set file [open "$srcdir/gcc.dg/builtins-config.h"]
set contents [read $file]
close $file
append contents {
#ifndef HAVE_C99_RUNTIME
#error !HAVE_C99_RUNTIME
#endif
}
check_no_compiler_messages_nocache c99_runtime assembly $contents
}]
}
So it comes from the gcc/testsuite/gcc.dg/builtins-config.h header, which says:
/* Define HAVE_C99_RUNTIME if the entire C99 runtime is available on
the target system. The value of HAVE_C99_RUNTIME should be the
same as the value of TARGET_C99_FUNCTIONS in the GCC machine
description. (Perhaps GCC should predefine a special macro
indicating whether or not TARGET_C99_FUNCTIONS is set, but it does
not presently do that.) */
and then later:
/* Newlib has the "f" variants of the math functions, but not the "l"
variants. TARGET_C99_FUNCTIONS is only defined if all C99
functions are present. Therefore, on systems using newlib, tests
of builtins will fail the "l" variants, and we should therefore not
define HAVE_C99_RUNTIME. Including <sys/types.h> gives us a way of
seeing if _NEWLIB_VERSION is defined. Including <math.h> would work
too, but the GLIBC math inlines cause us to generate inferior code,
which causes the test to fail, so it is not safe. Including <limits.h>
also fails because the include search paths are ordered such that GCC's
version will be found before the newlib version. Similarly, uClibc
lacks the C99 functions. */
More information about the Gcc
mailing list