This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [testsuite] fix C tests to use correct dg-error or dg-warning directive
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Mike Stump" <mrs at apple dot com>
- Cc: "Janis Johnson" <janis187 at us dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 May 2007 14:34:32 +0100
- Subject: Re: [testsuite] fix C tests to use correct dg-error or dg-warning directive
- References: <20070515183409.GA5212@us.ibm.com> <9F7E3509-D2D0-4C29-8B2C-5D514ABE959F@apple.com>
On 16/05/07, Mike Stump <mrs@apple.com> wrote:
On May 15, 2007, at 11:34 AM, Janis Johnson wrote:
> This currently makes no difference because the DejaGnu support
> doesn't pay attention to the message prefix, but Manuel and I are
> working on a patch to change that within the GCC testsuite support;
> see PR 25241.
Wonderful. I'd vote against dg-gcc-warning, once done, it would
never be undone. :-( What's your current thinking, one language at
a time and not doing dg-gcc-warning?
The current plan is to fix dg-warning and dg-error for the C
front-end. (Actually, we already have patches for all C tests
"failing" at i686).
We are not going to use a new dg-gcc-warning. Check the comments at
PR25241 for the complete discussion. There is a small risk that we
miss some flawed tests in some targets. We hope people will test
Janis's patch for target-specific tests. If you have any question
about this, please ask Janis or me.
Some tips for new tests until we check-in the patch:
1) Don't be afraid to use { dg-warning "warning: whatever" }. This
currently ensures that we actually emit a warning and it can be fixed
automatically just before committing Janis's patch.
2) If you want to match a "note:" message, please use { dg-warning
"note: whatever" } or at least { dg-warning "note" }. We can detect
this pattern and fix it automatically. Otherwise, we will have to fix
it manually.
3) Use several dg-* for several messages. The current test framework
allows to match:
warning: foo
error: bar
with a single dg-warning "foo". But that hopefully will break in the
future. So please use { dg-warning "foo" } { dg-error "bar" }. This
also applies for 2 warnings or 2 errors.
I hope this helps.
Manuel.