mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
* ar.c (main): Support POSIX-compatible argument parsing.
testsuite: * binutils-all/ar.exp (argument_parsing): New test.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user