This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[PATCH] GAS: Testsuite missed assertion failure fix


Hi,

 While running the MIPS testsuite for the mipsel-linux target I've noticed 
an internal error/assertion failure in a test case which was regardless 
marked as passed -- see below:

Executing on host: sh -c {../as-new   .../gas/testsuite/gas/all/weakref4.s 2>gas.stderr}  /dev/null  (timeout = 300)
.../gas/testsuite/gas/all/weakref4.s: Assembler messages:
.../gas/testsuite/gas/all/weakref4.s:3: Error: symbol `Wnm1' is already defined
.../gas/testsuite/gas/all/weakref4.s:6: Error: symbol `Wum2' is already defined
.../gas/testsuite/gas/all/weakref4.s:10: Error: symbol `Wwm3' is already defined
.../gas/testsuite/gas/all/weakref4.s:16: Error: symbol `lr1' is already defined
.../gas/testsuite/gas/all/weakref4.s:21: Error: symbol `lr2' is already defined
.../gas/testsuite/gas/all/weakref4.s:39: Error: symbol `lr6' is already defined
.../gas/testsuite/gas/all/weakref4.s:44: Error: symbol `lr7' is already defined
.../gas/testsuite/gas/all/weakref4.s:45: Internal error!
Assertion failure in mips_align at config/tc-mips.c line 12449.
Please report this bug.
PASS: is already defined

This is certainly not the intent the testsuite has been prepared for.

 The reason is the gas_test_error Tcl procedure succeeds whenever any 
output appears on stderr from GAS, regardless of whether it is the 
expected one or not.  A possible future improvement might include an 
regexp to match on stderr to be passed to the procedure.

 However I believe it is unreasonable and impractical to request all the 
callers to provide regexps that would not match assertion failures, so to 
address this problem, regardless of the possible future improvement 
mentioned, I propose the following fix, which makes gas_test_error not to 
accept stderr output that matches a recognised internal error/assertion 
failure message regardless of whether the output would otherwise qualify 
as a pass.  I think these failures are special enough they deserve 
explicit handling.

 While debugging it I found the fact output being matched is only logged 
for passes a nuisance, so I propose to change it too.

2009-09-12  Maciej W. Rozycki  <macro@linux-mips.org>

	* lib/gas-defs.exp (gas_test_error): Mark internal error/assertion 
	failures seen in output as fails.  Also record output being 
	matched for fails.

 Regression tested for the mipsel-linux and mips64-linux targets, with the 
expected regressions observed for "is already defined" and no other ones.  
OK to apply to the trunk?  I suggest to propagate it to 2.20, together 
with a fix for the internal error/assertion failure seen I will be sending 
separately straight away.

  Maciej

binutils-2.19.51-gas-test-error.patch
Index: binutils-2.19.51-mipsel/gas/testsuite/lib/gas-defs.exp
===================================================================
--- binutils-2.19.51-mipsel.orig/gas/testsuite/lib/gas-defs.exp
+++ binutils-2.19.51-mipsel/gas/testsuite/lib/gas-defs.exp
@@ -222,14 +222,14 @@ proc gas_test_error { file as_opts testn
     global comp_output
 
     gas_run $file $as_opts ">/dev/null"
-    if ![string match "" $comp_output] then {
-	send_log "$comp_output\n"
-	verbose "$comp_output" 3
-    }
-    if [string match "" $comp_output] then {
-	fail "$testname"
-    } else {
+    send_log "$comp_output\n"
+    verbose "$comp_output" 3
+    if { ![string match "" $comp_output]
+	 && ![string match "*Assertion failure*" $comp_output]
+	 && ![string match "*Internal error*" $comp_output] } then {
 	pass "$testname"
+    } else {
+	fail "$testname"
     }
 }
 


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