public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom de Vries <vries@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-3449] [testsuite] Add effective target ident_directive Date: Fri, 25 Sep 2020 07:07:36 +0000 (GMT) [thread overview] Message-ID: <20200925070736.3C56D3857015@sourceware.org> (raw) https://gcc.gnu.org/g:fa91ca7f506b162d5f0afcffd2d7d562da6aa7fa commit r11-3449-gfa91ca7f506b162d5f0afcffd2d7d562da6aa7fa Author: Tom de Vries <tdevries@suse.de> Date: Thu Sep 24 10:49:02 2020 +0200 [testsuite] Add effective target ident_directive On nvptx we run into: ... FAIL: c-c++-common/ident-1b.c -Wc++-compat scan-assembler GCC: FAIL: c-c++-common/ident-2b.c -Wc++-compat scan-assembler GCC: ... Using a scan-assembler directive adds -fno-indent to the compile options. The test c-c++-common/ident-1b.c adds dg-options "-fident", and intends to check that the -fident overrides the -fno-indent, by means of the scan-assembler. But for nvptx, there's no .ident directive, both with -fident and -fno-ident. Fix this by adding an effective target ident_directive, and requiring it in both test-cases. Tested on nvptx and x86_64. gcc/testsuite/ChangeLog: 2020-09-24 Tom de Vries <tdevries@suse.de> * lib/target-supports.exp (check_effective_target_ident_directive): New proc. * c-c++-common/ident-1b.c: Require effective target ident_directive. * c-c++-common/ident-2b.c: Same. Diff: --- gcc/testsuite/c-c++-common/ident-1b.c | 1 + gcc/testsuite/c-c++-common/ident-2b.c | 1 + gcc/testsuite/lib/target-supports.exp | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/gcc/testsuite/c-c++-common/ident-1b.c b/gcc/testsuite/c-c++-common/ident-1b.c index 69567442a03..b8b83e64ad2 100644 --- a/gcc/testsuite/c-c++-common/ident-1b.c +++ b/gcc/testsuite/c-c++-common/ident-1b.c @@ -2,6 +2,7 @@ * Make sure scan-assembler turns off .ident unless -fident in testcase */ /* { dg-do compile } */ /* { dg-options "-fident" } */ +/* { dg-require-effective-target ident_directive }*/ int i; /* { dg-final { scan-assembler "GCC: " { xfail { { hppa*-*-hpux* && { ! lp64 } } || { powerpc-ibm-aix* || powerpc*-*-darwin* } } } } } */ diff --git a/gcc/testsuite/c-c++-common/ident-2b.c b/gcc/testsuite/c-c++-common/ident-2b.c index fae6a031571..52f0693e164 100644 --- a/gcc/testsuite/c-c++-common/ident-2b.c +++ b/gcc/testsuite/c-c++-common/ident-2b.c @@ -2,6 +2,7 @@ * Make sure scan-assembler-times turns off .ident unless -fident in testcase */ /* { dg-do compile } */ /* { dg-options "-fident" } */ +/* { dg-require-effective-target ident_directive }*/ int ident; /* { dg-final { scan-assembler "GCC: " { xfail { { hppa*-*-hpux* && { ! lp64 } } || { powerpc-ibm-aix* || powerpc*-*-darwin* } } } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 5cbe32ffbd6..0a00972edb5 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -10510,3 +10510,12 @@ proc check_symver_available { } { } }] } + +# Return 1 if emitted assembly contains .ident directive. + +proc check_effective_target_ident_directive {} { + return [check_no_messages_and_pattern ident_directive \ + "(?n)^\[\t\]+\\.ident" assembly { + int i; + }] +}
reply other threads:[~2020-09-25 7:07 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200925070736.3C56D3857015@sourceware.org \ --to=vries@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /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: linkBe 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).