patchDejaGnu - Patches: patch #9371, Handle relative line numbers in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9371: Handle relative line numbers in dg-{error,warning,bogus}

Submitter:  Tom de Vries <vries>
Submitted:  Thu 01 Jun 2017 09:21:19 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Mon 03 Dec 2018 01:13:18 AM UTC, comment #1: 

Can you please re-post this to the GNU bug tracking system for DejaGnu? See https://debbugs.gnu.org/ We are closing down the DejaGnu patch tracker in Savannah. Thanks.

Ben Elliston <bje>
Group administrator
Thu 01 Jun 2017 09:21:19 PM UTC, original submission:  

This patch adds relative line number support to dejagnu.


I.

dg-error et al accept line numbers:
...
# dg-error regexp comment [{ target/xfail selector } [{.|0|linenum}]]
# indicate an error message <regexp> is expected on this line
# (the test fails if it doesn't occur)
# linenum=0 for general tool messages (eg: -V arg missing).
# "." means the current line.
...

When testing for a single message on the same line, we don't need to specify a line number:
...
ind a; /* { dg-error "unknown type name ind" "" } */
...

But when testing for two messages on the same line, we need a line number in the second test:
...
ind a[]; /* { dg-error "unknown type name ind" "" } */
/* { dg-warning "assumed to have one element" "" { target --* } 1 } */
...


II.

Using absolute line numbers is fragile though. When modifying the testcase (f.i., by adding a dg-require-effective-target line at the start) the line number needs to be updated.

In the gcc testsuite, relative line numbers (with .-1 meaning the previous line and .+1 meaning the next line) have been added as a means to work around that. So, the previous example can be rewritten as:

...
ind a[]; /* { dg-error "unknown type name ind" "" } */
/* { dg-warning "assumed to have one element" "" { target --* } .-1 } */
...

Tom de Vries <vries>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bje (Posted a comment)
  • -email is unavailable- added by vries (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-03 bje Open/ClosedOpen Closed
    2018-12-03 bje StatusNone Wont Do
    2017-06-01 vries Attached File- Added 0001-Handle-relative-line-numbers-in-dg-error-warning-bogus.patch, #40838

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code