Re: Dejagnu: Catch cc1 regexp errors without associated line number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Maxim Blinov <maxim.blinov@xxxxxxxxxxxx> writes:
> Hi all,
>
> I was looking to add a test case for a failure of the following form:
>
> $ riscv32-unknown-elf-gcc -O2 -march=rv32ip0_zunknownname -mabi=ilp32 -o test attr-z-failed-1.c 
> cc1: error: '-march=rv32ip0_zunknownname': Unknown Z ISA extension: 'zunknownname'
>
> I had a look at
> https://gcc.gnu.org/onlinedocs/gccint/Test-Directives.html
>
> and found "dg-error", "dg-warning", "dg-message", and "dg-bogus". But
> these directives seem to strictly require a line number, and my error
> doesn't have one associated with it.

You can use a line number of 0 for messages that don't have an
associated line number, e.g.:

/* { dg-error "'-fcf-protection=full' is not supported for this target" "" { target { ! "i?86-*-* x86_64-*-*" } } 0 } */

Thanks,
Richard

> There is another directive called "dg-excess-errors", but it doesn't
> have a regexp option, and from my understanding only serves to catch a
> nonzero exit status.
>
> Can someone suggest another directive or approach? I'm not too
> familiar with the GCC testing infrastructure.
>
> Best Regards,
> Maxim



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux