This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Add test for stripping on archive
- From: "H . J . Lu" <hjl at lucon dot org>
- To: binutils at sourceware dot cygnus dot com
- Date: Wed, 28 Nov 2001 23:59:50 -0800
- Subject: PATCH: Add test for stripping on archive
I'd like to check in this patch tomorrow if I don't get any objections
by then.
H.J.
----
2001-11-28 H.J. Lu <hjl@gnu.org>
* binutils-all/objcopy.exp (strip_test): Add strip on archive.
Index: binutils/testsuite/binutils-all/objcopy.exp
===================================================================
RCS file: /work/cvs/gnu/binutils/binutils/testsuite/binutils-all/objcopy.exp,v
retrieving revision 1.5
diff -u -p -r1.5 objcopy.exp
--- binutils/testsuite/binutils-all/objcopy.exp 2001/11/15 16:24:52 1.5
+++ binutils/testsuite/binutils-all/objcopy.exp 2001/11/29 07:45:51
@@ -314,6 +314,7 @@ if {$low == "" || $origstart == ""} then
# Test stripping an object.
proc strip_test { } {
+ global AR
global CC
global STRIP
global STRIPFLAGS
@@ -323,6 +324,34 @@ proc strip_test { } {
global subdir
set test "strip"
+
+ if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } {
+ untested $test
+ return
+ }
+
+ if [is_remote host] {
+ set archive libstrip.a
+ set objfile [remote_download host tmpdir/testprog.o];
+ remote_file host delete $archive
+ } else {
+ set archive tmpdir/libstrip.a
+ set objfile tmpdir/testprog.o
+ }
+
+ remote_file build delete tmpdir/libstrip.a
+
+ set exec_output [binutils_run $AR "rc $archive ${objfile}"]
+ if ![string match "" $exec_output] {
+ fail $test
+ return
+ }
+
+ set exec_output [binutils_run $STRIP "$STRIPFLAGS $archive"]
+ if ![string match "" $exec_output] {
+ fail $test
+ return
+ }
if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } {
untested $test