public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5766] Make sure that we get unique test names if several DejaGnu directives refer to the same line [PR1027
@ 2021-12-03  8:27 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2021-12-03  8:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:31c200c6e110ced8732332376e69c0958985b926

commit r12-5766-g31c200c6e110ced8732332376e69c0958985b926
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Wed Sep 22 12:42:41 2021 +0200

    Make sure that we get unique test names if several DejaGnu directives refer to the same line [PR102735]
    
            gcc/testsuite/
            PR testsuite/102735
            * lib/gcc-dg.exp (process-message): Make sure that we get unique
            test names.

Diff:
---
 gcc/testsuite/lib/gcc-dg.exp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 7edd070d71d..78a6c3651ef 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-03  8:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  8:27 [gcc r12-5766] Make sure that we get unique test names if several DejaGnu directives refer to the same line [PR1027 Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).