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