Re: relative line numbers and dg-line directive

Tom de Vries <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.