On 21/12/06, Janis Johnson <[EMAIL PROTECTED]> wrote:
On Wed, Dec 20, 2006 at 03:06:34PM +0100, Jan Eissfeld wrote:
> Hi,
>
> PR19978 reports that some overflow warnings are emitted multiple times. Like
for example,
>
> test.c:6: warning: integer overflow in expression
> test.c:6: warning: integer overflow in expression
> test.c:6: warning: integer overflow in expression
>
> The current testsuite will match any number of those to a single {
> dg-warning }. I don't know whether this is a known limitation, a bug
> on the testsuite or it just needs some magic.
>
> How could I test that exactly one warning was emitted?
See http://gcc.gnu.org/ml/gcc/2006-12/msg00000.html for an ugly solution,
and the rest of the thread for problems with this approach. The check
for getting the warning must be in a separate test from the check for
multiple warnings.
Janis
Or even better, see
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00588.html which fixes
that PR and adds testcases to prevent regressing on this.
It is still awaiting for review, though. ;-)