aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all/ar.exp
diff options
context:
space:
mode:
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