+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
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}]