public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
	Sandra Loosemore <sandra@codesourcery.com>,
	<gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Test for sigsetjmp support in analyzer tests requiring that feature.
Date: Thu, 2 Apr 2020 12:09:05 +0200	[thread overview]
Message-ID: <c6c05bd7-fba7-7b19-596d-a3e179b41c32@codesourcery.com> (raw)
In-Reply-To: <87bloans9a.fsf@euler.schwinge.homeip.net>

Interestingly, only those two testcases use the effective-target check:
gcc.dg/analyzer/sigsetjmp-5.c, gcc.dg/analyzer/sigsetjmp-6.c

Regarding the link test: No header file is included – it just
defines the function ("extern char $funcname();") and calls it.
The check fails as "sigsetjmp" does not exist in glibc –
the symbol is "__sigsetjmp" in glibc.

If one includes '#include <setjmp.h>', it works – even without
explicitly setting _POSIX_C_SOURCE.

BTW: sigsetjmp is also used by the following testcase, but without the
effective-target check:
g++.dg/asan/asan_test.cc, g++.dg/torture/pr57190.C, gcc.dg/pr69167.c,
gcc.dg/torture/float128-exact-underflow.c,
gcc.dg/torture/float128-extendxf-underflow.c,
gcc.dg/torture/pr57147-3.c, gcc.dg/torture/pr81900.c,
gcc.dg/ubsan/pr94423.c, gcc.target/sh/torture/pr30807.c

Cheers,

Tobias

On 4/2/20 11:36 AM, Thomas Schwinge wrote:

> Hi!
>
> On 2020-03-22T11:31:31-0600, Sandra Loosemore <sandra@codesourcery.com> wrote:
>> The new-ish analyzer test cases sigsetjmp-5.c and sigsetjmp-6.c were
>> failing on nios2-elf and probably other newlib targets due to lack of
>> support for sigsetjmp.  I didn't see a suitable existing
>> effective-target test for this, so I added one.
>> --- a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
>> +++ b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
>> @@ -1,3 +1,5 @@
>> +/* { dg-require-effective-target sigsetjmp } */
>> --- a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
>> +++ b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
>> @@ -1,3 +1,5 @@
>> +/* { dg-require-effective-target sigsetjmp } */
>> --- a/gcc/testsuite/lib/target-supports.exp
>> +++ b/gcc/testsuite/lib/target-supports.exp
>> +# Returns 1 if "sigsetjmp" is available on the target system.
>> +
>> +proc check_effective_target_sigsetjmp {} {
>> +    return [check_function_available "sigsetjmp"]
>> +}
> That got pushed to master branch as commit
> adaf4b6c66e789d927684003b9ee05ed04c105ea "Test for sigsetjmp support in
> analyzer tests requiring that feature".
>
> On x86_64-pc-linux-gnu I now see these tests regress to:
>
>      UNSUPPORTED: gcc.dg/analyzer/sigsetjmp-5.c
>      UNSUPPORTED: gcc.dg/analyzer/sigsetjmp-6.c
>
> ..., because of:
>
>      Executing on host: [xgcc] sigsetjmp_available6728.c [...] -fno-builtin  -lm    -o sigsetjmp_available6728.exe    (timeout = 300)
>      spawn [xgcc] sigsetjmp_available6728.c [...] -fno-builtin -lm -o sigsetjmp_available6728.exe
>      /tmp/ccKsf87z.o: In function `main':
>      sigsetjmp_available6728.c:(.text+0xa): undefined reference to `sigsetjmp'
>      collect2: error: ld returned 1 exit status
>      [...]
>
> Does that maybe have something to do with feature test macros required
> for 'sigsetjmp'?
>
>
> Grüße
>   Thomas
> -----------------
> Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
> Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

  reply	other threads:[~2020-04-02 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-22 17:31 Sandra Loosemore
2020-03-22 18:13 ` David Malcolm
2020-04-02  9:36 ` Thomas Schwinge
2020-04-02 10:09   ` Tobias Burnus [this message]
2020-04-02 20:45     ` Sandra Loosemore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6c05bd7-fba7-7b19-596d-a3e179b41c32@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sandra@codesourcery.com \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).