This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: DejaGnu directive matching multiple messages on the same line
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Martin Sebor <msebor at gmail dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Mon, 25 Jul 2016 16:55:02 +0000
- Subject: Re: DejaGnu directive matching multiple messages on the same line
- Authentication-results: sourceware.org; auth=none
- References: <578FDCC3.80609@gmail.com> <20160720202821.GA7387@tucnak.redhat.com>
On Wed, 20 Jul 2016, 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 } */
But use something distinct in place of "", as if you use "" (or more
generally, the same string for multiple dg-error on the same line) then
you get multiple test assertions with the same name (the string that
appears after PASS: or FAIL: in the .sum file), which is bad for comparing
test results.
--
Joseph S. Myers
joseph@codesourcery.com