diff options
author | Alan Modra <amodra@gmail.com> | 2010-03-26 01:42:36 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-03-26 01:42:36 +0000 |
commit | a45fc99392bdce4c67b43b1a0a05c77e7112afab (patch) | |
tree | 3cf39ae806fd1d469ac8472546bf33c34cfea5ab /binutils/testsuite/binutils-all | |
parent | 1352b58a73806af902717edb51b732a9f5a6af84 (diff) | |
download | gdb-a45fc99392bdce4c67b43b1a0a05c77e7112afab.zip gdb-a45fc99392bdce4c67b43b1a0a05c77e7112afab.tar.gz gdb-a45fc99392bdce4c67b43b1a0a05c77e7112afab.tar.bz2 |
* binutils-all/ar.exp (unique_symbol): New test.
Diffstat (limited to 'binutils/testsuite/binutils-all')
-rw-r--r-- | binutils/testsuite/binutils-all/ar.exp | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp index 3ad868b..ab1afdc 100644 --- a/binutils/testsuite/binutils-all/ar.exp +++ b/binutils/testsuite/binutils-all/ar.exp @@ -1,4 +1,4 @@ -# Copyright 1995, 1997, 2002, 2004, 2007, 2008, 2009 +# Copyright 1995, 1997, 2002, 2004, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -399,6 +399,45 @@ proc deterministic_archive { } { pass $testname } +proc unique_symbol { } { + global AR + global AS + global NM + global srcdir + global subdir + + set testname "ar unique symbol in archive" + + if ![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o] { + unresolved $testname + } + + if [is_remote host] { + set archive artest.a + set objfile [remote_download host tmpdir/unique.o] + remote_file host delete $archive + } else { + set archive tmpdir/artest.a + set objfile tmpdir/unique.o + } + + remote_file build delete tmpdir/artest.a + + set got [binutils_run $AR "-s -r -c $archive ${objfile}"] + if ![string match "" $got] { + fail $testname + return + } + + set got [binutils_run $NM "--print-armap $archive"] + if ![string match "*foo in *unique.o*" $got] { + fail $testname + return + } + + pass $testname +} + # Run the tests. long_filenames @@ -407,3 +446,6 @@ thin_archive thin_archive_with_nested argument_parsing deterministic_archive +if [is_elf_format] { + unique_symbol +} |