aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog4
-rw-r--r--binutils/testsuite/binutils-all/ar.exp38
2 files changed, 41 insertions, 1 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 17166e4..6c8de84 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-27 Andreas Schwab <schwab@suse.de>
+
+ * binutils-all/ar.exp (argument_parsing): New test.
+
2004-02-20 Nathan Sidwell <nathan@codesourcery.com>
* binutils-all/objcopy.exp: Reorder arguments for POSIXLY_CORRECT
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