From: Jakub Jelinek Date: Fri, 23 Sep 2016 07:46:15 +0000 (+0200) Subject: gcc-dg.exp (process-message): Support relative line number notation - .+4 or .-1... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2e81d0585673e93f4225599f190c6764ddb0fec;p=gcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 75e7b3e075d..facc0d0a4d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-09-23 Jakub Jelinek + + * 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 PR target/77676 diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index b7f0ff7838a..9c2e041ba35 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -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}]