[testsuite] Fix g++.old-deja/g++.pt/const2.C on Solaris

Message ID yddo9n4axtu.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show
  • [testsuite] Fix g++.old-deja/g++.pt/const2.C on Solaris
Related show

Commit Message

Rainer Orth Dec. 12, 2017, 1:18 p.m.
Between 20171112 (r254663) and 20171113 (r254700) a testcase regressed
on Solaris (32 and 64-bit, sparc and x86):

+FAIL: g++.old-deja/g++.pt/const2.C  -std=c++11 (test for excess errors)
+FAIL: g++.old-deja/g++.pt/const2.C  -std=c++14 (test for excess errors)
+FAIL: g++.old-deja/g++.pt/const2.C  -std=c++98 (test for excess errors)

We now have

Excess errors:
Undefined                       first referenced
A<int>::i                           /var/tmp//ccgwU71c.o

compared to

output is:
Undefined                       first referenced
 symbol                             in file
A<int>::i                           /var/tmp//ccgwU71c.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status

before.  The failure was caused by

	[Diagnostic Patch] don't print column zero
        * lib/gcc-dg.exp (process-message): Use -: for no column.

With runtest -v -v -v, I now find

{{} WARNING { [^
]*i} {}}

while before it had been

{{} WARNING {[^
]*i} {}}

Note the additional space after "WARNING {" now.

This space is printed unconditionally here

    set expmsg "$column $msgprefix\[^\n\]*$expmsg"

which inserts space after $column even if $column is empty

The following patch fixes it by emitting the space only as needed.

Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, and x86_64-pc-linux-gnu, installed on mainline.


Rainer Orth, Center for Biotechnology, Bielefeld University

2017-11-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* lib/gcc-dg.exp (process-message): Avoid additional whitespace in


# HG changeset patch
# Parent  6257289977f79d04fd93d77940bc71433e2aa7aa
Fix g++.old-deja/g++.pt/const2.C on Solaris

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -1103,14 +1103,15 @@  proc process-message { msgproc msgprefix
 	# Remove it from the original expression and move it
 	# to the proper place in the search expression.
 	set expmsg [string range $expmsg [string length $column] end]
+	set column "$column "
     } elseif [string match "" [lindex $newentry 0]] {
 	# The specified line number is 0; don't expect a column number.
     } else {
 	# There is no column number in the search expression, but we
 	# should expect one in the message itself.
-	set column {[0-9]+:}
+	set column {[0-9]+: }
-    set expmsg "$column $msgprefix\[^\n\]*$expmsg"
+    set expmsg "$column$msgprefix\[^\n\]*$expmsg"
     set newentry [lreplace $newentry 2 2 $expmsg]
     set dg-messages [lreplace ${dg-messages} end end $newentry]