On Mon, 2017-04-24 at 11:20 -0400, David Malcolm wrote: > On Sat, 2017-04-22 at 19:49 +0200, Tom de Vries wrote: > > Hi, > > > > there are currently two types of line number supported in > > dg-{error,warning,message,bogus} directives: absolute and relative. > > With an absolute line number, it's immediately clear what line > > number > > is > > meant, but when a line is added at the start of the file, the line > > number needs to be updated. With a relative line number, that > > problem > > is solved, but when relative line numbers become large, it becomes > > less > > clear what line it refers to, and when adding a line inbetween the > > directive using the relative line number and the line it refers to, > > the > > relative line number still needs to be updated. > > > > This patch adds a directive dg-save-linenr with argument varname, > > that > > saves the line number of the directive in a variable varname, which > > can > > be used as line number in dg directives. > > > > Testing status: > > - tested updated test-case objc.dg/try-catch-12.m > > - ran tree-ssa.exp > > > > RFC: > > - good idea? > > Excellent idea; thanks! There are various places where I'd find this > useful
e.g. the test cases within https://gcc.gnu.org/ml/gcc-patches/2017-04/msg01061.html