* binutils-all/ar.exp: Don't run unique_symbol on msp or hpux.
[deliverable/binutils-gdb.git] / binutils / testsuite / binutils-all / ar.exp
index e85201410bde4ab6c4d95abd100e518fec6dacc2..4b8a2dabad56a3d8a25b6fc7184056ea73f03992 100644 (file)
@@ -1,4 +1,5 @@
-#   Copyright 1995, 1997, 2002, 2004, 2007, 2008 Free Software Foundation, Inc.
+#   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
 # it under the terms of the GNU General Public License as published by
@@ -398,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
@@ -406,3 +446,8 @@ thin_archive
 thin_archive_with_nested
 argument_parsing
 deterministic_archive
+if { [is_elf_format]
+     && ![istarget "*-*-hpux*"]
+     && ![istarget "msp*-*-*"] } {
+    unique_symbol
+}
This page took 0.026485 seconds and 4 git commands to generate.