[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix simulator needs_status_wrapper/testglue usage without dejagnu-1.4.4
From: |
Hans-Peter Nilsson |
Subject: |
Fix simulator needs_status_wrapper/testglue usage without dejagnu-1.4.4 patches |
Date: |
Mon, 13 Sep 2004 08:39:26 -0400 (EDT) |
I finally got around to investigate the brokenness in execution
tests for mmix-knuth-mmixware. Thankfully it was not a "real"
breakage, but only due to gcc now emitting warnings while
building the status-wrapper, and the dejagnu machinery
subsequently barfing in a kind of cached-lossage way. Looking
around, I found drow's message at
<URL:http://gcc.gnu.org/ml/gcc/2004-08/msg00961.html>. That
would work (it's in dejagnu CVS), but as mec points out, we do
need something locally in gcc for this. We need it not only
until dejagnu-1.4.5 is released, but as the comment points out
in the patch, for whenever we "feel like breaking" the testglue
code again by emitting new warnings.
A few .exp's had more-or-less inadequate copies of the
testglue-building code, so I saw it as a inseparable change ;-)
to move them all to one place. This place is not gcc-defs.exp
(where it is loaded from for the benefit of all .exp:s loading
that file) but in a separate file. This is for the benefit of
other testsuites that want to refer to it without catching the
other definitions, notably libstdc++-v3. I did not change the
testsuite for libjava or other lib* testsuites that may need
changing, because I can't test that kind of change: it'd need a
simulator cross target that runs libjava and needs a status
wrapper. Quite spuriously I choose to update treelang.exp
anyway (though treelang doesn't build as cross), because the
change is identical to the other files in gcc/testsuite/lib.
This is in contrast to libjava, which needs to change more (yet
trivial) stuff e.g. wrap_compile_flags to wrap_flags.
Tested cross to mmix-mmixware-sim (needing wrapper) and cross to
cris-axis-linux-gnu (no wrapper) and native (no wrapper ;-)
i686-pc-linux-gnu (except the libstdc++-v3 change, which I forgot there).
Ok to commit?
libstdc++-v3:
* testsuite/lib/libstdc++.exp: Use gcc wrapper.exp and call
libstdc++_maybe_build_wrapper instead of using local code.
gcc/testsuite:
* lib/gcc-defs.exp: Load wrapper.exp.
* lib/g++.exp (g++_init): Call g++_maybe_build_wrapper instead of
using local code.
* lib/gcc.exp (gcc_init): Similar.
* lib/gfortran.exp (gfortran_init): Similar.
* lib/objc.exp (objc_init): Similar.
* lib/treelang.exp (treelang_init): Similar.
* lib/wrapper.exp: New file with build_wrapper call machinery in
${tool}_maybe_build_wrapper.
Index: libstdc++.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp,v
retrieving revision 1.22
diff -p -c -r1.22 libstdc++.exp
*** libstdc++.exp 19 Jul 2004 23:11:03 -0000 1.22
--- libstdc++.exp 13 Sep 2004 12:23:16 -0000
*************** load_lib libgloss.exp
*** 50,55 ****
--- 50,56 ----
load_gcc_lib target-supports.exp
load_lib prune.exp
load_lib dg-options.exp
+ load_gcc_lib wrapper.exp
# Useful for debugging. Pass the name of a variable and the verbosity
# threshold (number of -v's on the command line).
*************** proc libstdc++_init { testfile } {
*** 208,224 ****
}
}
! if { [target_info needs_status_wrapper]!=""} {
! file delete ${objdir}/testglue.o;
! set gluefile ${objdir}/testglue.o;
! set result [build_wrapper $gluefile];
! if { $result != "" } {
! set gluefile [lindex $result 0];
! set wrap_flags [lindex $result 1];
! } else {
! unset gluefile
! }
! }
}
# Callback from system dg-test.
--- 209,215 ----
}
}
! libstdc++_maybe_build_wrapper "${objdir}/testglue.o"
}
# Callback from system dg-test.
--- /dev/null Tue Jan 1 05:00:00 1980
+++ wrapper.exp Sun Sep 12 06:33:20 2004
@@ -0,0 +1,42 @@
+# Copyright (C) 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file contains GCC-specifics for status wrappers for test programs.
+
+# ${tool}_maybe_build_wrapper -- Build wrapper object if the target needs it.
+
+proc ${tool}_maybe_build_wrapper { filename } {
+ global gluefile wrap_flags
+
+ if { [target_info needs_status_wrapper] != "" \
+ && [target_info needs_status_wrapper] != "0" \
+ && ![info exists gluefile] } {
+ set saved_wrap_compile_flags [target_info wrap_compile_flags]
+ # The wrapper code may contain code that gcc objects on. This
+ # became true for dejagnu-1.4.4. The set of warnings and code
+ # that gcc objects on may change, so just make sure -w is always
+ # passed to turn off all warnings.
+ set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags -w"
+ set result [build_wrapper $filename];
+ set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags"
+ if { $result != "" } {
+ set gluefile [lindex $result 0];
+ set wrap_flags [lindex $result 1];
+ } else {
+ unset gluefile
+ }
+ }
+}
? wrapper.exp
Index: g++.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g++.exp,v
retrieving revision 1.40
diff -p -c -r1.40 g++.exp
*** g++.exp 30 Jul 2004 10:34:12 -0000 1.40
--- g++.exp 12 Sep 2004 23:20:25 -0000
***************
*** 1,4 ****
! # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
--- 1,4 ----
! # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
*************** proc g++_init { args } {
*** 249,264 ****
unset gluefile
}
! if { [target_info needs_status_wrapper] != "" } {
! set gluefile ${tmpdir}/g++-testglue.o;
! set result [build_wrapper $gluefile];
! if { $result != "" } {
! set gluefile [lindex $result 0];
! set wrap_flags [lindex $result 1];
! } else {
! unset gluefile
! }
! }
set ALWAYS_CXXFLAGS ""
--- 249,255 ----
unset gluefile
}
! g++_maybe_build_wrapper "${tmpdir}/g++-testglue.o"
set ALWAYS_CXXFLAGS ""
cvs diff: cannot find g77-dg.exp
cvs diff: cannot find g77.exp
Index: gcc-defs.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/gcc-defs.exp,v
retrieving revision 1.2
diff -p -c -r1.2 gcc-defs.exp
*** gcc-defs.exp 5 Jun 2003 22:18:54 -0000 1.2
--- gcc-defs.exp 12 Sep 2004 23:20:25 -0000
***************
*** 1,4 ****
! # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
--- 1,4 ----
! # Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
***************
*** 14,19 ****
--- 14,21 ----
# along with this program; if not, write to the Free Software
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ load_lib wrapper.exp
+
#
# ${tool}_check_compile -- Reports and returns pass/fail for a compilation
#
Index: gcc.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/gcc.exp,v
retrieving revision 1.14
diff -p -c -r1.14 gcc.exp
*** gcc.exp 18 Jun 2004 23:48:44 -0000 1.14
--- gcc.exp 12 Sep 2004 23:20:25 -0000
***************
*** 1,4 ****
! # Copyright (C) 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001, 2003 Free
Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
--- 1,4 ----
! # Copyright (C) 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001, 2003, 2004
Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
*************** proc gcc_init { args } {
*** 106,123 ****
if ![info exists tmpdir] then {
set tmpdir /tmp
}
! if {[target_info needs_status_wrapper] != "" && \
! [target_info needs_status_wrapper] != "0" && \
! ![info exists gluefile]} {
! set gluefile ${tmpdir}/gcc-testglue.o;
! set result [build_wrapper $gluefile];
! if { $result != "" } {
! set gluefile [lindex $result 0];
! set wrap_flags [lindex $result 1];
! } else {
! unset gluefile
! }
! }
}
#
--- 106,113 ----
if ![info exists tmpdir] then {
set tmpdir /tmp
}
!
! gcc_maybe_build_wrapper "${tmpdir}/gcc-testglue.o"
}
#
Index: gfortran.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/gfortran.exp,v
retrieving revision 1.5
diff -p -c -r1.5 gfortran.exp
*** gfortran.exp 30 Jul 2004 10:34:12 -0000 1.5
--- gfortran.exp 12 Sep 2004 23:20:25 -0000
*************** proc gfortran_init { args } {
*** 187,202 ****
unset gluefile
}
! if { [target_info needs_status_wrapper] != "" } {
! set gluefile ${tmpdir}/gfortran-testglue.o;
! set result [build_wrapper $gluefile];
! if { $result != "" } {
! set gluefile [lindex $result 0];
! set wrap_flags [lindex $result 1];
! } else {
! unset gluefile
! }
! }
set ALWAYS_GFORTRANFLAGS ""
--- 187,193 ----
unset gluefile
}
! gfortran_maybe_build_wrapper "${tmpdir}/gfortran-testglue.o"
set ALWAYS_GFORTRANFLAGS ""
cvs diff: cannot find mike-g77.exp
Index: objc.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/objc.exp,v
retrieving revision 1.24
diff -p -c -r1.24 objc.exp
*** objc.exp 18 Jun 2004 23:48:44 -0000 1.24
--- objc.exp 12 Sep 2004 23:20:25 -0000
***************
*** 1,4 ****
! # Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
--- 1,4 ----
! # Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
*************** proc objc_init { args } {
*** 107,122 ****
if ![info exists tmpdir] then {
set tmpdir /tmp
}
! if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
! set gluefile ${tmpdir}/objc-testglue.o;
! set result [build_wrapper $gluefile];
! if { $result != "" } {
! set gluefile [lindex $result 0];
! set wrap_flags [lindex $result 1];
! } else {
! unset gluefile
! }
! }
set objc_libgcc_s_path "${rootme}"
set compiler [lindex $OBJC_UNDER_TEST 0]
--- 107,114 ----
if ![info exists tmpdir] then {
set tmpdir /tmp
}
!
! objc_maybe_build_wrapper "${tmpdir}/objc-testglue.o"
set objc_libgcc_s_path "${rootme}"
set compiler [lindex $OBJC_UNDER_TEST 0]
Index: treelang.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/treelang.exp,v
retrieving revision 1.3
diff -p -c -r1.3 treelang.exp
*** treelang.exp 18 Jun 2004 23:48:44 -0000 1.3
--- treelang.exp 12 Sep 2004 23:20:25 -0000
*************** proc treelang_init { args } {
*** 104,119 ****
if ![info exists tmpdir] then {
set tmpdir /tmp
}
! if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
! set gluefile ${tmpdir}/treelang-testglue.o;
! set result [build_wrapper $gluefile];
! if { $result != "" } {
! set gluefile [lindex $result 0];
! set wrap_flags [lindex $result 1];
! } else {
! unset gluefile
! }
! }
set treelang_libgcc_s_path "${rootme}"
set compiler [lindex $TREELANG_UNDER_TEST 0]
--- 104,111 ----
if ![info exists tmpdir] then {
set tmpdir /tmp
}
!
! treelang_maybe_build_wrapper "${tmpdir}/treelang-testglue.o"
set treelang_libgcc_s_path "${rootme}"
set compiler [lindex $TREELANG_UNDER_TEST 0]
brgds, H-P
- Fix simulator needs_status_wrapper/testglue usage without dejagnu-1.4.4 patches,
Hans-Peter Nilsson <=