This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[RFA:] ld run_dump_test: use append without space for "error" and "warning"
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: binutils at sourceware dot org
- Date: Thu, 17 May 2012 05:27:41 +0200
- Subject: [RFA:] ld run_dump_test: use append without space for "error" and "warning"
In a new linker test-case using run_dump_test, I was surprised
to see the concatenated error lines (two "#error:" lines) having
an unwanted extra space in the "seam". Here's a fix for that.
An "egrep -2 '#[ ]*(warning|error)[ ]*:' **/*.d" in
ld/testsuite says there was only one test using multiple warning
options (ld-cris/pcrelcp-1.d), where the second emitted line
happens to begin with spaces, hence (mostly accidentally) already
extra-whitespace-agnostic and no existing test-cases needing
adjustments.
Tested cris-elf with the new test.
Ok to commit?
ld/testsuite:
* lib/ld-lib.exp (run_dump_test): For options "warning" and
"error", append to earlier option values without adding a space.
Index: lib/ld-lib.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v
retrieving revision 1.91
diff -p -u -r1.91 ld-lib.exp
--- lib/ld-lib.exp 3 Apr 2012 16:01:38 -0000 1.91
+++ lib/ld-lib.exp 17 May 2012 03:14:20 -0000
@@ -623,7 +623,18 @@ proc run_dump_test { name } {
if { $opt_name == "as" || $opt_name == "ld" } {
set opt_val [subst $opt_val]
}
- set opts($opt_name) [concat $opts($opt_name) $opt_val]
+
+ # Append differently whether it's a message (without space) or
+ # an option or list (with space).
+ switch -- $opt_name {
+ warning -
+ error {
+ append opts($opt_name) $opt_val
+ }
+ default {
+ set opts($opt_name) [concat $opts($opt_name) $opt_val]
+ }
+ }
}
foreach opt { as ld } {
regsub {\[big_or_little_endian\]} $opts($opt) \
brgds, H-P