50 lines · plain
1RUN: rm -rf %t && mkdir -p %t/foo/bar/2 3RUN: yaml2obj %S/Inputs/elf.yaml -o %t/foo/elf.o4RUN: cp %t/foo/elf.o %t/foo/bar/elf.o5RUN: cp %t/foo/bar/elf.o %t/delete.o6 7Test that modules can be added with absolute paths when the archive is created using an absolute path8 9RUN: llvm-ar rc --thin %t/absolute-1a.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o10RUN: llvm-ar --thin d %t/absolute-1a.ar delete.o11 12RUN: FileCheck --input-file=%t/absolute-1a.ar --check-prefixes=THIN,CHECK %s -DPATH=%/t/13RUN: llvm-ar t %t/absolute-1a.ar | FileCheck %s -DPATH=%/t/14 15RUN: llvm-ar rTc %t/absolute-1b.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o16RUN: llvm-ar dT %t/absolute-1b.ar delete.o17RUN: cmp %t/absolute-1a.ar %t/absolute-1b.ar18 19These tests must be run in %t/foo. cd %t is included on each line to make debugging this test case easier.20 21Test that modules can be added with absolute paths when the archive is created using a relative path22 23RUN: cd %t/foo && llvm-ar rTc bar/absolute-2.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o24RUN: cd %t/foo && llvm-ar dT bar/absolute-2.ar %t/delete.o25 26RUN: FileCheck -input-file=%t/foo/bar/absolute-2.ar --check-prefixes=THIN,CHECK %s -DPATH=%/t/27RUN: llvm-ar t %t/foo/bar/absolute-2.ar | FileCheck %s -DPATH=%/t/28 29Test that modules can be added with relative paths when the archive is created using a relative path30 31RUN: cd %t/foo && llvm-ar rTc ../relative-1.ar elf.o ../delete.o bar/elf.o32RUN: cd %t/foo && llvm-ar dT ../relative-1.ar delete.o33 34RUN: FileCheck -input-file=%t/relative-1.ar --check-prefixes=THIN,CHECK %s -DPATH=35RUN: llvm-ar t %t/relative-1.ar | FileCheck %s -DPATH=%/t/36 37Test that modules can be added with relative paths when the archive is created using a absolute path38 39RUN: cd %t/foo && llvm-ar rTc %t/relative-2.ar elf.o ../delete.o bar/elf.o40RUN: cd %t/foo && llvm-ar dT %t/relative-2.ar delete.o41 42RUN: FileCheck -input-file=%t/relative-2.ar --check-prefixes=THIN,CHECK %s -DPATH=43RUN: llvm-ar t %t/relative-2.ar | FileCheck %s -DPATH=%/t/44 45THIN: !<thin>46 47CHECK-NOT: delete.o48CHECK: {{^}}[[PATH]]foo/elf.o49CHECK: {{^}}[[PATH]]foo/bar/elf.o50