1 # RUN: rm -rf %t && split-file %s %t
4 # RUN: yaml2obj %S/Inputs/elf.yaml -o elf.o
5 # RUN: llvm-ar -rc elf.a elf.o text.txt
6 # RUN: llvm-ar -rc --thin thin-elf.a elf.o text.txt
9 # RUN: llvm-ar -M < delete.mri
10 # RUN: llvm-ar tv delete.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
14 ## Delete so the archive is empty.
15 # RUN: llvm-ar -M < empty.mri
16 # RUN: llvm-ar tv empty.ar | FileCheck %s --check-prefixes=EMPTY --allow-empty
20 ## Attempt to delete a file that is not in the archive.
21 # RUN: llvm-ar -M < bad.mri
22 # RUN: llvm-ar tv bad.ar | FileCheck %s --check-prefixes=BOTH
24 ## Delete operation in a script with comments.
25 # RUN: llvm-ar -M < comment.mri
26 # RUN: llvm-ar tv comment.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
28 ## Add a file that has been deleted.
29 # RUN: llvm-ar -M < re-add.mri
30 # RUN: llvm-ar tv re-add.ar | FileCheck %s --check-prefixes=BOTH
35 ## Add the same file twice and delete them. It is expected behaviour
36 ## that one delete command deletes all matching members.
37 # RUN: llvm-ar -M < duplicate.mri
38 # RUN: llvm-ar tv duplicate.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
40 ## Add and delete the same file twice.
41 # RUN: llvm-ar -M < duplicate-re-add.mri
42 # RUN: llvm-ar tv duplicate-re-add.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
44 ## Attempt to delete the same file twice.
45 # RUN: llvm-ar -M < extra-delete.mri
46 # RUN: llvm-ar tv extra-delete.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
48 ## Add the same file to a thin archive twice.
49 # RUN: llvm-ar -M < thin-duplicate.mri
50 # RUN: llvm-ar tv thin-duplicate.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
52 ## Delete a file after it was added via ADDLIB.
53 # RUN: llvm-ar -M < addlib.mri
54 # RUN: llvm-ar tv addlib.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
56 ## Attempt to delete an archive after it was added via ADDLIB.
57 # RUN: llvm-ar -M < addlib-deletelib.mri
58 # RUN: llvm-ar tv addlib-deletelib.ar | FileCheck %s --check-prefixes=BOTH
60 ## Add the same archive twice to a thin archive and then delete some members.
61 # RUN: llvm-ar -M < addlib-thin-duplicate.mri
62 # RUN: llvm-ar tv addlib-thin-duplicate.ar | FileCheck %s --check-prefixes=DELETE --implicit-check-not=elf.o
120 #--- duplicate-re-add.mri
121 create duplicate-re-add.ar
130 #--- extra-delete.mri
131 create extra-delete.ar
139 #--- thin-duplicate.mri
140 createthin thin-duplicate.ar
155 #--- addlib-deletelib.mri
156 create addlib-deletelib.ar
162 #--- addlib-thin-duplicate.mri
163 createthin addlib-thin-duplicate.ar