1 RUN: rm -rf %t && mkdir -p %t/foo/bar/
3 RUN: yaml2obj %S/Inputs/elf.yaml -o %t/foo/elf.o
4 RUN: cp %t/foo/elf.o %t/foo/bar/elf.o
5 RUN: cp %t/foo/bar/elf.o %t/delete.o
7 Test that modules can be added with absolute paths when the archive is created using an absolute path
9 RUN: llvm-ar rc --thin %t/absolute-1a.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o
10 RUN: llvm-ar --thin d %t/absolute-1a.ar delete.o
12 RUN: FileCheck --input-file=%t/absolute-1a.ar --check-prefixes=THIN,CHECK %s -DPATH=%/t/
13 RUN: llvm-ar t %t/absolute-1a.ar | FileCheck %s -DPATH=%/t/
15 RUN: llvm-ar rTc %t/absolute-1b.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o
16 RUN: llvm-ar dT %t/absolute-1b.ar delete.o
17 RUN: cmp %t/absolute-1a.ar %t/absolute-1b.ar
19 These tests must be run in %t/foo. cd %t is included on each line to make debugging this test case easier.
21 Test that modules can be added with absolute paths when the archive is created using a relative path
23 RUN: cd %t/foo && llvm-ar rTc bar/absolute-2.ar %t/foo/elf.o %t/delete.o %t/foo/bar/elf.o
24 RUN: cd %t/foo && llvm-ar dT bar/absolute-2.ar %t/delete.o
26 RUN: FileCheck -input-file=%t/foo/bar/absolute-2.ar --check-prefixes=THIN,CHECK %s -DPATH=%/t/
27 RUN: llvm-ar t %t/foo/bar/absolute-2.ar | FileCheck %s -DPATH=%/t/
29 Test that modules can be added with relative paths when the archive is created using a relative path
31 RUN: cd %t/foo && llvm-ar rTc ../relative-1.ar elf.o ../delete.o bar/elf.o
32 RUN: cd %t/foo && llvm-ar dT ../relative-1.ar delete.o
34 RUN: FileCheck -input-file=%t/relative-1.ar --check-prefixes=THIN,CHECK %s -DPATH=
35 RUN: llvm-ar t %t/relative-1.ar | FileCheck %s -DPATH=%/t/
37 Test that modules can be added with relative paths when the archive is created using a absolute path
39 RUN: cd %t/foo && llvm-ar rTc %t/relative-2.ar elf.o ../delete.o bar/elf.o
40 RUN: cd %t/foo && llvm-ar dT %t/relative-2.ar delete.o
42 RUN: FileCheck -input-file=%t/relative-2.ar --check-prefixes=THIN,CHECK %s -DPATH=
43 RUN: llvm-ar t %t/relative-2.ar | FileCheck %s -DPATH=%/t/
48 CHECK: {{^}}[[PATH]]foo/elf.o
49 CHECK: {{^}}[[PATH]]foo/bar/elf.o