This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [testsuite] fix C tests to use correct dg-error or dg-warning directive

On 16/05/07, Mike Stump <> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]