# 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.
#
pass $testname
}
+
set testname "map to directory"
if {![ld_link $ld tmpdir/map-address \
} 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
+}