Commit f2e81d05 by Jakub Jelinek Committed by Jakub Jelinek

gcc-dg.exp (process-message): Support relative line number notation - .+4 or .-1 etc.

	* lib/gcc-dg.exp (process-message): Support relative line number
	notation - .+4 or .-1 etc.
	* gcc.dg/dg-test-1.c: New test.

From-SVN: r240391
parent aaa1b10f
2016-09-23 Jakub Jelinek <jakub@redhat.com>
* lib/gcc-dg.exp (process-message): Support relative line number
notation - .+4 or .-1 etc.
* gcc.dg/dg-test-1.c: New test.
2016-09-22 Martin Sebor <msebor@redhat.com>
PR target/77676
......
......@@ -986,6 +986,13 @@ if { [info procs saved-dg-error] == [list] \
proc process-message { msgproc msgprefix dgargs } {
upvar dg-messages dg-messages
# Handle relative line specification, .+1 or .-1 etc.
if { [llength $dgargs] == 5
&& [regsub "^\.\[+-\](\[0-9\])$" [lindex $dgargs 4] "\\1" num] } {
set num [expr [lindex $dgargs 0] [string index [lindex $dgargs 4] 1] $num]
set dgargs [lreplace $dgargs 4 4 $num]
}
# Process the dg- directive, including adding the regular expression
# to the new message entry in dg-messages.
set msgcnt [llength ${dg-messages}]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment