From: David Malcolm <dmalcolm@redhat.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: gcc-patches@gcc.gnu.org, David Malcolm <dmalcolm@redhat.com>
Subject: [committed] Fix warning in gcc.dg/plugin/expensive_selftests_plugin.c with !CHECKING_P
Date: Wed, 03 Jan 2018 19:10:00 -0000 [thread overview]
Message-ID: <1515006846-51525-1-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <87o9mc9ffb.fsf@linux-m68k.org>
On Tue, 2018-01-02 at 21:25 +0100, Andreas Schwab wrote:
> /daten/gcc/gcc-
> 20180101/gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c:175
> :1: warning: no return statement in function returning non-void [-
> Wreturn-type]
>
> Andreas.
Thanks.
I forgot to handle the --enable-checking=release case here; sorry.
I've committed the following patch to trunk to fix this (as r256183),
under the "obvious fixes" rule, borrowing the note from
toplev::run_self_tests to give the dg-regexp something to look for for
the !CHECKING_P case.
Tested with and without --enable-checking=release.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/expensive-selftests-1.c: Update regexp to handle
the !CHECKING_P case by expecting a note.
* gcc.dg/plugin/expensive_selftests_plugin.c (plugin_init): Issue
a note for the !CHECKING_P case, and move the return statement
outside of #if CHECKING_P guard.
---
gcc/testsuite/gcc.dg/plugin/expensive-selftests-1.c | 2 +-
gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/plugin/expensive-selftests-1.c b/gcc/testsuite/gcc.dg/plugin/expensive-selftests-1.c
index e464117..64f168d 100644
--- a/gcc/testsuite/gcc.dg/plugin/expensive-selftests-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/expensive-selftests-1.c
@@ -1,3 +1,3 @@
int not_empty;
-/* { dg-regexp "expensive_selftests_plugin: .* pass\\(es\\) in .* seconds" } */
+/* { dg-regexp "expensive_selftests_plugin: .* pass\\(es\\) in .* seconds|not enabled in this build" } */
diff --git a/gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c b/gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c
index 9470764..a7c6728 100644
--- a/gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c
+++ b/gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c
@@ -170,6 +170,8 @@ plugin_init (struct plugin_name_args *plugin_info,
PLUGIN_FINISH,
selftest::expensive_tests,
NULL); /* void *user_data */
- return 0;
+#else
+ inform (UNKNOWN_LOCATION, "self-tests are not enabled in this build");
#endif /* #if CHECKING_P */
+ return 0;
}
--
1.8.5.3
prev parent reply other threads:[~2018-01-03 19:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 20:30 [PATCH] Expensive selftests: torture testing for fix-it boundary conditions (PR c/82050) David Malcolm
2017-12-11 16:11 ` PING: " David Malcolm
2017-12-11 23:14 ` Jeff Law
2018-01-02 20:25 ` Andreas Schwab
2018-01-03 19:10 ` David Malcolm [this message]
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=1515006846-51525-1-git-send-email-dmalcolm@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=schwab@linux-m68k.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: 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).