]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-scripts/map-address.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-scripts / map-address.exp
index 1f9457a8cdbac1a30e48f4a67efa4a95bebe76ef..587a98d887380d5aad772fdb1b5b6786c57c4010 100644 (file)
@@ -1,5 +1,5 @@
 # Test address printed by --print-map
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -46,6 +46,7 @@ if {[regexp_diff \
     pass $testname
 }
 
+
 set testname "map to directory"
 
 if {![ld_link $ld tmpdir/map-address \
@@ -67,3 +68,49 @@ if {[regexp_diff \
 } else {
     pass $testname
 }
+
+
+set testname "map to % directory"
+
+if {![ld_link $ld tmpdir/map-address \
+        "$LDFLAGS -T $srcdir/$subdir/map-address.t \
+         tmpdir/map-address.o \
+         -Map=tmpdir/% --output fred"]} {
+    fail $testname
+    return
+}
+
+if [is_remote host] then {
+    remote_upload host "tmpdir/fred.map"
+}
+
+if {[regexp_diff \
+              "tmpdir/fred.map" \
+              "$srcdir/$subdir/map-address.d"]} {
+    fail $testname
+} else {
+    pass $testname
+}
+
+
+set testname "map to %.foo directory"
+
+if {![ld_link $ld tmpdir/map-address \
+        "$LDFLAGS -T $srcdir/$subdir/map-address.t \
+         tmpdir/map-address.o \
+         -Map=tmpdir/%.foo --output fred"]} {
+    fail $testname
+    return
+}
+
+if [is_remote host] then {
+    remote_upload host "tmpdir/fred.foo"
+}
+
+if {[regexp_diff \
+              "tmpdir/fred.foo" \
+              "$srcdir/$subdir/map-address.d"]} {
+    fail $testname
+} else {
+    pass $testname
+}