3 # RUN: rm -rf %t && mkdir -p %t
4 # RUN: yaml2obj %s -o %t/1.o --docnum=1
5 # RUN: yaml2obj %s -o %t/2.o --docnum=2
7 ## Append single member:
8 # RUN: llvm-ar qc %t/single.a %t/1.o
9 # RUN: llvm-ar t %t/single.a \
10 # RUN: | FileCheck %s --check-prefix=SINGLE --match-full-lines --implicit-check-not {{.}}
14 # RUN: llvm-nm --print-armap %t/single.a \
15 # RUN: | FileCheck %s --check-prefix=SINGLE-SYM
19 ## Append multiple members:
20 # RUN: llvm-ar qc %t/multiple.a %t/1.o %t/2.o
21 # RUN: llvm-ar t %t/multiple.a \
22 # RUN: | FileCheck %s --check-prefix=MULTIPLE --match-full-lines --implicit-check-not {{.}}
27 # RUN: llvm-nm --print-armap %t/multiple.a \
28 # RUN: | FileCheck %s --check-prefix=MULTIPLE-SYM
30 # MULTIPLE-SYM: symbol1
31 # MULTIPLE-SYM-NEXT: symbol2
33 ## Append same member:
34 # RUN: llvm-ar qc %t/same.a %t/1.o %t/1.o
35 # RUN: llvm-ar t %t/same.a \
36 # RUN: | FileCheck %s --check-prefix=SAME -DFILE=%t/2.o --match-full-lines --implicit-check-not {{.}}
41 # RUN: llvm-nm --print-armap %t/same.a \
42 # RUN: | FileCheck %s --check-prefix=SAME-SYM
45 # SAME-SYM-NEXT: symbol1
47 ## Append without member:
48 # RUN: llvm-ar qc %t/without.a
49 # RUN: llvm-ar t %t/without.a | count 0
51 # RUN: llvm-nm --print-armap %t/without.a | count 0
54 # RUN: not llvm-ar qc 2>&1 \
55 # RUN: | FileCheck %s --check-prefix=NO-ARCHIVE
57 # NO-ARCHIVE: error: An archive name must be specified.
59 ## Member does not exist:
60 # RUN: not llvm-ar qc %t/missing.a %t/missing.txt 2>&1 \
61 # RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt
63 # MISSING-FILE: error: [[FILE]]: {{[nN]}}o such file or directory.