This is the mail archive of the gcc@gcc.gnu.org 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] |
On 07/20/2016 02:28 PM, Jakub Jelinek wrote:
On Wed, Jul 20, 2016 at 02:19:15PM -0600, Martin Sebor wrote:Is there a way to express a requirement that a single line cause two or more diagnostic messages (in any order) each matching one of the regex strings?Sure, and it is used many times in the testsuite. whatever; /* { dg-error "whatever1" } */ /* { dg-error "whatever2" "" { target *-*-* } 33 } */ You need to use the target specification and supply line number in the second and following directive which you want to apply to the same line.
Thanks! I'd seen this pattern but completely forgot about it. Let me update the Wiki. Btw., the above works fine when each directive is on its own line but when the second follows the first on the same line (somehow I thought it needed to be at first), the second one needs another string argument. I haven't looked into what it's for but the regex is the second argument in this case, not the first. Like this:whatever; // { dg-error "regex-1" } { dg-error "???" "regex2" "fail message" { target-selector } <line-number> }
Martin
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |