xref: /llvm-project/llvm/test/tools/llvm-ar/thin-to-regular-archive.test (revision 1f71b5a38605a4f101af43288ae22feb89c8a469)
1# XFAIL: system-aix
2## Test thin archives do not siletly convert to regular archives on write.
3
4# RUN: rm -f %tthin.a %tregular1.a %tregular2.a
5
6# RUN: llvm-ar -rc --thin %tthin.a %S/Inputs/a.txt
7# RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
8
9# RUN: llvm-ar -q %tthin.a %S/Inputs/b.txt
10# RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
11
12# RUN: llvm-ar -r %tthin.a %S/Inputs/c.txt
13# RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
14
15# RUN: llvm-ar -am %S/Inputs/a.txt %tthin.a %S/Inputs/c.txt
16# RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
17
18# RUN: llvm-ar -d %tthin.a %S/Inputs/c.txt
19# RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
20
21# THIN: !<thin>
22
23## Test that you can add a thin archive's contents to a regular archive with 'L'.
24# RUN: llvm-ar -qcL %tregular1.a %tthin.a
25# RUN: FileCheck --check-prefixes=REGULAR --input-file=%tregular1.a --implicit-check-not=thin.a %s
26
27# REGULAR: !<arch>
28# REGULAR: a.txt
29# REGULAR: b.txt
30
31## Test that you can add a thin archive's contents to an existing regular archive with 'L'.
32# RUN: llvm-ar -q %tregular2.a %S/Inputs/d.txt
33# RUN: llvm-ar -qL %tregular2.a %tthin.a
34# RUN: FileCheck --check-prefixes=REGULAR --input-file=%tregular2.a %s
35
36## Test that thin archives do not convert to regular archives with 'L' and no use of '--thin'.
37# RUN: llvm-ar -qL %tthin.a %tregular2.a
38# RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
39