brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 175b5ba Raw
33 lines · plain
1MSVC's lib.exe produces archives with absolute paths to the members. It's useful2for llvm-ar to extract them to their basename in the CWD, since usually the3directories in the path in the archive won't exist during archive extraction.4 5Get a temp clean cwd to extract into.6RUN: rm -rf %t && mkdir %t && cd %t7 8RUN: llvm-ar t %S/Inputs/absolute-paths.lib | FileCheck %s --check-prefix=CHECK-LIST9CHECK-LIST: C:/src/llvm-project/build/dne/b.o10CHECK-LIST: C:/src/llvm-project/build/dne/a.o11 12Check that a.o comes out and defines foo.13RUN: llvm-ar xP %S/Inputs/absolute-paths.lib 'C:/src/llvm-project/build/dne/a.o'14RUN: llvm-nm a.o | FileCheck %s --check-prefix=CHECK-A15CHECK-A: T foo16 17Check that b.o comes out and defines bar.18RUN: llvm-ar xP %S/Inputs/absolute-paths.lib C:/src/llvm-project/build/dne/b.o19RUN: llvm-nm b.o | FileCheck %s --check-prefix=CHECK-B20CHECK-B: T bar21 22xP above is only required because we were explicitly extracting items from an23archive with absolute paths. Extracting all objects doesn't need P because we24aren't explicitly requesting any individual object.25RUN: rm -f a.o b.o26RUN: llvm-ar x %S/Inputs/absolute-paths.lib27RUN: llvm-nm a.o | FileCheck %s --check-prefix=CHECK-A28RUN: llvm-nm b.o | FileCheck %s --check-prefix=CHECK-B29 30RUN: mkdir dir31RUN: llvm-ar x %S/Inputs/absolute-paths.lib --output=dir/32RUN: cmp a.o dir/a.o33