]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make sure that we get unique test names if several DejaGnu directives refer to the...
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 22 Sep 2021 10:42:41 +0000 (12:42 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 3 Dec 2021 08:24:48 +0000 (09:24 +0100)
gcc/testsuite/
PR testsuite/102735
* lib/gcc-dg.exp (process-message): Make sure that we get unique
test names.

gcc/testsuite/lib/gcc-dg.exp

index 7edd070d71dc3e5e49d0f807c7758d77f1735217..78a6c3651efcbfd97f20b2ae31513e8c4d1a2aca 100644 (file)
@@ -1191,8 +1191,18 @@ proc process-message { msgproc msgprefix dgargs } {
     upvar dg-messages dg-messages
 
     if { [llength $dgargs] == 5 } {
-       set num [get-absolute-line [lindex $dgargs 0] [lindex $dgargs 4]]
-       set dgargs [lreplace $dgargs 4 4 $num]
+       set useline [lindex $dgargs 0]
+
+       # Resolve absolute line number.
+       set line [get-absolute-line $useline [lindex $dgargs 4]]
+       set dgargs [lreplace $dgargs 4 4 $line]
+
+       if { $line != $useline } {
+           # Make sure that we get unique test names if different USELINEs
+           # refer to the same LINE.
+           set comment "[lindex $dgargs 2] at line $useline"
+           set dgargs [lreplace $dgargs 2 2 $comment]
+       }
     }
 
     # Process the dg- directive, including adding the regular expression