* ar.c (main): Support POSIX-compatible argument parsing.

testsuite:
	* binutils-all/ar.exp (argument_parsing): New test.
This commit is contained in:
Andreas Schwab
2004-02-27 11:04:36 +00:00
parent 1c3ff0f2a5
commit af865222e0
4 changed files with 146 additions and 85 deletions

View File

@ -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