This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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
	https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01911.html
[...]
        * lib/gcc-dg.exp (process-message): Use -: for no column.

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

process-message:
{{} WARNING { [^
]*i} {}}

while before it had been

process-message:
{{} 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

-- 
-----------------------------------------------------------------------------
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
	$expmsg.

# 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]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]