dejagnu
[Top][All Lists]
Advanced

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

Re: relative line numbers and dg-line directive


From: Tom de Vries
Subject: Re: relative line numbers and dg-line directive
Date: Wed, 24 May 2017 15:16:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 05/24/2017 12:18 AM, Ben Elliston wrote:
If we allowed multiple lines with "" as the line number, I don't think
it should break anything in existing testsuites, would it?

I don't know the answer to that.

IIUC, you're suggesting to replace a relative line number sequence:
...
{ dg-error ... }
{ dg-error ... .-1 }
{ dg-error ... .-2 }
{ dg-error ... .-3 }
...
with:
...
{ dg-error ... }
{ dg-error ... "" }
{ dg-error ... "" }
{ dg-error ... "" }
...
or some such?

There was some discussion on this in gcc bugzilla as well, summarized in 'PR80552 - Make consecutive relative line numbers more maintainable' (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80552 ). Proposals in summary:

a. continue means line number of next dg-{error,warning,message,bogus} is same as current one:
...
  foobar; /* { dg-warning "warning for foobar" continue }
             { dg-warning "another warning for foobar" continue }
             { dg-error "error for foobar" } */
....

b. continue means line number is indicated in previous dg-{e,w,m,b}:
...
    foobar;
    /* { dg-warning "warning for foobar" .-1 }
       Bla, bla, reasoning.
       { dg-warning "another warning for foobar" continue }
       Bla, bla, more reasoning.
       { dg-error "error for foobar" continue } */
...

c. dg-{e,w,m,b} between new dg-{begin,end}-same-line-output directives refer to the line number indicated by dg-begin-same-line-output:
...
    foobar;
    /* { dg-begin-same-line-output .-1 }
       ...
       { dg-warning "warning for foobar" }
       ...
       { dg-message "note for foobar" }
       ...
       { dg-error "error for foobar" }
       ...
       { dg-end-same-line-output }  */
...

Thanks,
- Tom



reply via email to

[Prev in Thread] Current Thread [Next in Thread]