1 MSVC's lib.exe produces archives with absolute paths to the members. It's useful
2 for llvm-ar to extract them to their basename in the CWD, since usually the
3 directories in the path in the archive won't exist during archive extraction.
5 Get a temp clean cwd to extract into.
6 RUN: rm -rf %t && mkdir %t && cd %t
8 RUN: llvm-ar t %S/Inputs/absolute-paths.lib | FileCheck %s --check-prefix=CHECK-LIST
9 CHECK-LIST: C:/src/llvm-project/build/dne/b.o
10 CHECK-LIST: C:/src/llvm-project/build/dne/a.o
12 Check that a.o comes out and defines foo.
13 RUN: llvm-ar xP %S/Inputs/absolute-paths.lib 'C:/src/llvm-project/build/dne/a.o'
14 RUN: llvm-nm a.o | FileCheck %s --check-prefix=CHECK-A
17 Check that b.o comes out and defines bar.
18 RUN: llvm-ar xP %S/Inputs/absolute-paths.lib C:/src/llvm-project/build/dne/b.o
19 RUN: llvm-nm b.o | FileCheck %s --check-prefix=CHECK-B
22 xP above is only required because we were explicitly extracting items from an
23 archive with absolute paths. Extracting all objects doesn't need P because we
24 aren't explicitly requesting any individual object.
26 RUN: llvm-ar x %S/Inputs/absolute-paths.lib
27 RUN: llvm-nm a.o | FileCheck %s --check-prefix=CHECK-A
28 RUN: llvm-nm b.o | FileCheck %s --check-prefix=CHECK-B
31 RUN: llvm-ar x %S/Inputs/absolute-paths.lib --output=dir/