1RUN: rm -rf %t && mkdir -p %t/foo/bar/ 2 3RUN: yaml2obj %S/Inputs/elf.yaml -o %t/foo/elf.o 4RUN: cp %t/foo/elf.o %t/foo/bar/elf.o 5RUN: cp %t/foo/bar/elf.o %t/delete.o 6 7Test that modules can be added with absolute paths when the archive is created using an absolute path 8 9RUN: llvm-ar rc --thin %t/absolute-1a.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o 10RUN: llvm-ar --thin d %t/absolute-1a.ar delete.o 11 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.o 16RUN: llvm-ar dT %t/absolute-1b.ar delete.o 17RUN: cmp %t/absolute-1a.ar %t/absolute-1b.ar 18 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 path 22 23RUN: cd %t/foo && llvm-ar rTc bar/absolute-2.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o 24RUN: cd %t/foo && llvm-ar dT bar/absolute-2.ar %t/delete.o 25 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 path 30 31RUN: cd %t/foo && llvm-ar rTc ../relative-1.ar elf.o ../delete.o bar/elf.o 32RUN: cd %t/foo && llvm-ar dT ../relative-1.ar delete.o 33 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 path 38 39RUN: cd %t/foo && llvm-ar rTc %t/relative-2.ar elf.o ../delete.o bar/elf.o 40RUN: cd %t/foo && llvm-ar dT %t/relative-2.ar delete.o 41 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.o 48CHECK: {{^}}[[PATH]]foo/elf.o 49CHECK: {{^}}[[PATH]]foo/bar/elf.o 50