[committed,testsuite,guality] Use absolute line number in pass/fail line

Message ID 20180804214637.dabqnrtm6bj6wkiv@delia
State New
Headers show
Series
  • [committed,testsuite,guality] Use absolute line number in pass/fail line
Related show

Commit Message

Tom de Vries Aug. 4, 2018, 9:46 p.m.
On Sat, Aug 04, 2018 at 05:45:59PM +0200, Andreas Schwab wrote:
> On Jul 09 2018, Tom de Vries <tdevries@suse.de> wrote:
> 
> > this patches uses relative line numbers in gcc.dg/guality where obvious:
> > either the relative line number is '.', '.-1' or '.+1', or adjacent to
> > another obvious case.
> 
> This introduced a lot of test names that are no longer unique.
> 

Fix in patch below.

Tested on x86_64.

Committed.

Thanks,
- Tom

[testsuite, guality] Use absolute line number in pass/fail line

2018-08-04  Tom de Vries  <tdevries@suse.de>

	* lib/gcc-gdb-test.exp: Use absolute line number in pass/fail line.

---
 gcc/testsuite/lib/gcc-gdb-test.exp | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Patch

diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp
index b13d3ec7f85..0066e157b42 100644
--- a/gcc/testsuite/lib/gcc-gdb-test.exp
+++ b/gcc/testsuite/lib/gcc-gdb-test.exp
@@ -54,18 +54,19 @@  proc gdb-test { useline args } {
 	set var $arg1
     }
 
-    set gdb_name $::env(GUALITY_GDB_NAME)
-    set testname "$testcase line [lindex $args 0] [lindex $args 1] == [lindex $args 2]"
-    set output_file "[file rootname [file tail $prog]].exe"
-    set cmd_file "[file rootname [file tail $prog]].gdb"
-
-    set fd [open $cmd_file "w"]
     set line [lindex $args 0]
     if { [string range $line 0 0] == "@" } {
 	set line [string range $line 1 end]
     } else {
 	set line [get-absolute-line $useline $line]
     }
+
+    set gdb_name $::env(GUALITY_GDB_NAME)
+    set testname "$testcase line $line [lindex $args 1] == [lindex $args 2]"
+    set output_file "[file rootname [file tail $prog]].exe"
+    set cmd_file "[file rootname [file tail $prog]].gdb"
+
+    set fd [open $cmd_file "w"]
     puts $fd "break $line"
     puts $fd "run"
     puts $fd "$command $var"