1 ## Test the move command without modifiers moves members to the end
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
6 # RUN: yaml2obj %s -o %t/3.o --docnum=3
9 # RUN: llvm-ar rc %t/single.a %t/1.o %t/2.o %t/3.o
10 # RUN: llvm-ar m %t/single.a %t/1.o
11 # RUN: llvm-ar t %t/single.a \
12 # RUN: | FileCheck %s --check-prefix=SINGLE --match-full-lines --implicit-check-not {{.}}
18 # RUN: llvm-nm --print-armap %t/single.a \
19 # RUN: | FileCheck %s --check-prefix=SINGLE-SYM
22 # SINGLE-SYM-NEXT: symbol3
23 # SINGLE-SYM-NEXT: symbol1
25 ## Move multiple members:
26 # RUN: llvm-ar rc %t/multiple.a %t/1.o %t/2.o %t/3.o
27 # RUN: llvm-ar m %t/multiple.a %t/1.o %t/2.o
28 # RUN: llvm-ar t %t/multiple.a \
29 # RUN: | FileCheck %s --check-prefix=MULTIPLE --match-full-lines --implicit-check-not {{.}}
35 # RUN: llvm-nm --print-armap %t/multiple.a \
36 # RUN: | FileCheck %s --check-prefix=MULTIPLE-SYM
38 # MULTIPLE-SYM: symbol3
39 # MULTIPLE-SYM-NEXT: symbol1
40 # MULTIPLE-SYM-NEXT: symbol2
43 # RUN: llvm-ar rc %t/same.a %t/1.o %t/2.o %t/3.o
44 # RUN: llvm-ar m %t/same.a %t/1.o %t/1.o
45 # RUN: llvm-ar t %t/same.a \
46 # RUN: | FileCheck %s --check-prefix=SAME -DFILE=%t/2.o
52 # RUN: llvm-nm --print-armap %t/same.a \
53 # RUN: | FileCheck %s --check-prefix=SAME-SYM
56 # SAME-SYM-NEXT: symbol3
57 # SAME-SYM-NEXT: symbol1
59 ## Move without member:
60 # RUN: llvm-ar rc %t/without.a %t/1.o %t/2.o %t/3.o
61 # RUN: llvm-ar m %t/without.a
62 # RUN: llvm-ar t %t/without.a \
63 # RUN: | FileCheck %s --match-full-lines --check-prefix=WITHOUT --implicit-check-not {{.}}
69 # RUN: llvm-nm --print-armap %t/without.a \
70 # RUN: | FileCheck %s --check-prefix=WITHOUT-SYM
72 # WITHOUT-SYM: symbol1
73 # WITHOUT-SYM-NEXT: symbol2
74 # WITHOUT-SYM-NEXT: symbol3
77 # RUN: not llvm-ar m 2>&1 \
78 # RUN: | FileCheck %s --check-prefix=NO-ARCHIVE
80 # NO-ARCHIVE: error: an archive name must be specified
82 ## Member does not exist:
83 # RUN: llvm-ar rc %t/missing.a %t/1.o %t/2.o %t/3.o
84 # RUN: not llvm-ar m %t/missing.a %t/missing.txt 2>&1 \
85 # RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt -DMSG=%errc_ENOENT
87 # MISSING-FILE: error: [[FILE]]: [[MSG]]