1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/LibDriver/use-paths.test
Reid Kleckner f2fcc61612 [llvm-ar] Make llvm-lib behave more like the MSVC archiver
Summary:
Use the filepath used to open the archive member as the archive member
name instead of the file basename. This path might be absolute or
relative.  This is important because the archive member name will show
up in the PDB, and we want our PDBs to look as much like MSVC's as
possible.

This also helps avoid an issue in our PDB module descriptor writing
code, which assumes that all module names are unique. Relative paths
still aren't guaranteed to be unique, but they're much better than
basenames, which definitely aren't unique.

Reviewers: ruiu, zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33575

llvm-svn: 305223
2017-06-12 19:45:35 +00:00

25 lines
814 B
Plaintext

llvm-lib should behave like "link.exe /lib" and use relative paths to describe
archive members.
First, get in a clean working directory.
RUN: rm -rf %t && mkdir -p %t && cd %t
Make foo/a.obj and foo/b.obj.
RUN: mkdir foo
RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/a.obj %S/Inputs/a.s
RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/b.obj %S/Inputs/b.s
RUN: llvm-lib -out:foo.lib foo/a.obj foo/b.obj
RUN: llvm-ar t foo.lib | FileCheck %s
FIXME: We should probably use backslashes on Windows to better match MSVC tools.
CHECK: foo/a.obj
CHECK: foo/b.obj
Do it again with absolute paths and see that we get something.
RUN: llvm-lib -out:foo.lib %t/foo/a.obj %t/foo/b.obj
RUN: llvm-ar t foo.lib | FileCheck %s --check-prefix=ABS
ABS: {{.*}}/foo/a.obj
ABS: {{.*}}/foo/b.obj