public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Looking at UNSUPPORTED dejagnu tests for a port...
@ 2021-03-30 19:23 Alan Lehotsky
  2021-03-30 19:35 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Lehotsky @ 2021-03-30 19:23 UTC (permalink / raw)
  To: gcc

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Looking at UNSUPPORTED dejagnu tests for a port...
  2021-03-30 19:23 Looking at UNSUPPORTED dejagnu tests for a port Alan Lehotsky
@ 2021-03-30 19:35 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-03-30 19:35 UTC (permalink / raw)
  To: apl; +Cc: gcc

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.  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-30 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 19:23 Looking at UNSUPPORTED dejagnu tests for a port Alan Lehotsky
2021-03-30 19:35 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).