aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all/ar.exp
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2004-02-27 11:04:36 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2004-02-27 11:04:36 +0000
commitaf865222e0ac6616ad54999257feb2e7132c5cdb (patch)
tree8e8b21dfb02d47a773c36efc2f74ec392d82a7f5 /binutils/testsuite/binutils-all/ar.exp
parent1c3ff0f2a51472fbecbbf1069f2570980b14ec9a (diff)
downloadgdb-af865222e0ac6616ad54999257feb2e7132c5cdb.zip
gdb-af865222e0ac6616ad54999257feb2e7132c5cdb.tar.gz
gdb-af865222e0ac6616ad54999257feb2e7132c5cdb.tar.bz2
* ar.c (main): Support POSIX-compatible argument parsing.
testsuite: * binutils-all/ar.exp (argument_parsing): New test.
Diffstat (limited to 'binutils/testsuite/binutils-all/ar.exp')
-rw-r--r--binutils/testsuite/binutils-all/ar.exp38
1 files changed, 37 insertions, 1 deletions
diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index f418e94..7f01c76 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -1,4 +1,4 @@
-# Copyright 1995, 1997 Free Software Foundation, Inc.
+# Copyright 1995, 1997, 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
@@ -214,7 +214,43 @@ proc symbol_table { } {
pass $testname
}
+# Test POSIX-compatible argument parsing.
+
+proc argument_parsing { } {
+ global AR
+ global AS
+ global srcdir
+ global subdir
+
+ set testname "ar argument parsing"
+
+ if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o] {
+ unresolved $testname
+ return
+ }
+
+ if [is_remote host] {
+ set archive artest.a
+ set objfile [remote_download host tmpdir/bintest.o]
+ remote_file host delete $archive
+ } else {
+ set archive tmpdir/artest.a
+ set objfile tmpdir/bintest.o
+ }
+
+ remote_file build delete tmpdir/artest.a
+
+ set got [binutils_run $AR "-r -c $archive ${objfile}"]
+ if ![string match "" $got] {
+ fail $testname
+ return
+ }
+
+ pass $testname
+}
+
# Run the tests.
long_filenames
symbol_table
+argument_parsing