binutils-gdb/ld/testsuite/ld-misc/input-remap.exp
Alan Modra fd67aa1129 Update year range in copyright notice of binutils files
Adds two new external authors to etc/update-copyright.py to cover
bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then
updates copyright messages as follows:

1) Update cgen/utils.scm emitted copyrights.
2) Run "etc/update-copyright.py --this-year" with an extra external
   author I haven't committed, 'Kalray SA.', to cover gas testsuite
   files (which should have their copyright message removed).
3) Build with --enable-maintainer-mode --enable-cgen-maint=yes.
4) Check out */po/*.pot which we don't update frequently.
2024-01-04 22:58:12 +10:30

76 lines
2.0 KiB
Plaintext

# Test handling of --input-remap
# Copyright (C) 2023-2024 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# First make sure that linking without remapping does not work:
file delete tmpdir/foo.o
setup_xfail *-*-*
run_ld_link_tests {
{ "--remap-inputs (expected fail)"
""
"-e 0"
"-o tmpdir/barzzz.o"
{foo.s}
{}
"foo" }
}
global srcdir
global subdir
# Now use the remap options to allow the linking to succeed.
# Note: we have to use the [list... format when we need to
# have $-substitutions.
run_ld_link_tests [list \
{ "--remap-inputs (simple)"
"--remap-inputs=tmpdir/foo.o=tmpdir/barzzz.o"
"-e 0"
"-o tmpdir/barzzz.o"
{foo.s}
{}
"foo"
} \
{ "--remap-inputs (wildcard)"
"--remap-inputs=*/foo.o=tmpdir/barzzz.o"
"-e 0"
"-o tmpdir/barzzz.o"
{foo.s}
{}
"foo"
} \
[ list "--remap-inputs-file" \
"--remap-inputs-file $srcdir/$subdir/remaps.txt" \
"-e 0 bazzz.o" \
"-o tmpdir/barzzz.o" \
{foo.s} \
{} \
"foo" \
] \
[ list "--remap-inputs-file (with map output)" \
"--remap-inputs-file $srcdir/$subdir/remaps.txt" \
"-e 0 --print-map" \
"-o tmpdir/barzzz.o" \
{foo.s} \
{ { ld remaps.r } } \
"foo" \
] \
]