1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
llvm-mirror/test/tools/llvm-ar/absolute-paths.test
Reid Kleckner 2f8f001e86 [llvm-ar] Extract objects to their basename in the CWD
This is helpful when extracting objects from archives produced by MSVC's
lib.exe, which users absolute paths to describe the archive members.

llvm-svn: 299264
2017-03-31 21:10:53 +00:00

21 lines
872 B
Plaintext

MSVC's lib.exe produces archives with absolute paths to the members. It's useful
for llvm-ar to extract them to their basename in the CWD, since usually the
directories in the path in the archive won't exist during archive extraction.
Get a temp clean cwd to extract into.
RUN: rm -rf %t && mkdir %t && cd %t
RUN: llvm-ar t %S/Inputs/absolute-paths.lib | FileCheck %s --check-prefix=CHECK-LIST
CHECK-LIST: C:/src/llvm-project/build/dne/b.o
CHECK-LIST: C:/src/llvm-project/build/dne/a.o
Check that a.o comes out and defines foo.
RUN: llvm-ar x %S/Inputs/absolute-paths.lib 'C:/src/llvm-project/build/dne/a.o'
RUN: llvm-nm a.o | FileCheck %s --check-prefix=CHECK-A
CHECK-A: T foo
Check that b.o comes out and defines bar.
RUN: llvm-ar x %S/Inputs/absolute-paths.lib C:/src/llvm-project/build/dne/b.o
RUN: llvm-nm b.o | FileCheck %s --check-prefix=CHECK-B
CHECK-B: T bar