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: PR gas/3918: make check RUNTESTFLAGS=i386.exp doesn't work


The problem is gas_finish. runtest.exp will call ${tool}_finish if it
exists. But gas_finish isn't intended to be called by runtest.exp
and should only be used with gas_start. When

# make check RUNTESTFLAGS=i386.exp

is used, gas_finish is called without gas_start and closes the wrong
fd. We can rename gas_finish. But it is used in 250 places. This patch
adds gas_started to make sure that it will be used when gas_start.


H.J.
----
2007-03-05  H.J. Lu  <hongjiu.lu@intel.com>

	PR gas/3918
	* lib/gas-defs.exp (gas_started): New variable. Initialized to
	0.
	(gas_start): Set gas_started to 1.
	(gas_finish): Skip if gas_started is 0.  Reset gas_started to 0.

--- gas/testsuite/lib/gas-defs.exp.test	2005-07-04 07:55:52.000000000 -0700
+++ gas/testsuite/lib/gas-defs.exp	2007-03-05 12:59:07.000000000 -0800
@@ -53,12 +53,17 @@ proc all_ones { args } {
     return 1
 }
 
+set gas_started 0
+
 proc gas_start { prog as_opts } {
     global AS
     global ASFLAGS
     global srcdir
     global subdir
     global spawn_id
+    global gas_started
+
+    set gas_started 1
 
     verbose -log "Starting $AS $ASFLAGS $as_opts $prog" 2
     catch {
@@ -71,9 +76,13 @@ proc gas_start { prog as_opts } {
 
 proc gas_finish { } {
     global spawn_id
+    global gas_started
 
-    catch "close"
-    catch "wait"
+    if { $gas_started == 1 } {
+	catch "close"
+	catch "wait"
+	set gas_started 0
+    }
 }
 
 proc want_no_output { testname } {


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