aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all/nm.exp
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/testsuite/binutils-all/nm.exp')
-rw-r--r--binutils/testsuite/binutils-all/nm.exp31
1 files changed, 31 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/nm.exp b/binutils/testsuite/binutils-all/nm.exp
index 69944eb..8375893 100644
--- a/binutils/testsuite/binutils-all/nm.exp
+++ b/binutils/testsuite/binutils-all/nm.exp
@@ -207,4 +207,35 @@ if [regexp $want $got] then {
fail "nm --size-sort"
}
+if [is_elf_format] {
+ # PR binutils/20751
+ # Test nm --with-symbol-versions
+
+ if {![binutils_assemble $srcdir/$subdir/nm-ver.s tmpdir/nm-ver.o]} then {
+ fail "nm --with-symbol-versions (assembling)"
+ } else {
+ if [is_remote host] {
+ set tmpfile [remote_download host tmpdir/nm-ver.o]
+ } else {
+ set tmpfile tmpdir/nm-ver.o
+ }
+
+ set got [binutils_run $NM "$NMFLAGS --with-symbol-versions --format sysv $tmpfile"]
+
+ if {! [regexp "foo@VER_1" $got]} then {
+ fail "nm --with-symbol-versions (grep for @VER_1)"
+ } else {
+ if {! [regexp "foo@VER_1" $got]} then {
+ fail "nm --with-symbol-versions (grep for @@VER_2)"
+ } else {
+ pass "nm --with-symbol-versions"
+ }
+ }
+
+ if { $verbose < 1 } {
+ remote_file host delete "tmpdir/nm-ver.o"
+ }
+ }
+}
+
# There are certainly other tests that could be run.