reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
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 xP %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 xP %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

xP above is only required because we were explicitly extracting items from an
archive with absolute paths. Extracting all objects doesn't need P because we
aren't explicitly requesting any individual object.
RUN: rm -f a.o b.o
RUN: llvm-ar x %S/Inputs/absolute-paths.lib
RUN: llvm-nm a.o | FileCheck %s --check-prefix=CHECK-A
RUN: llvm-nm b.o | FileCheck %s --check-prefix=CHECK-B