1 ## Test the ADDLIB MRI command.
3 # RUN: rm -rf %t && split-file %s %t
5 # RUN: yaml2obj %s -o f.o
6 # RUN: llvm-ar r f.a f.o
8 ## Merge contents of archives.
9 # RUN: llvm-ar -M < add-lib.mri
10 # RUN: llvm-nm --print-armap add-lib.a | FileCheck --check-prefix=SYMS %s
11 # RUN: llvm-ar t add-lib.a | FileCheck --check-prefix=FILES %s
16 ## ADDLIB with non-archive file.
17 # RUN: not llvm-ar -M < bad-lib.mri 2>&1 | FileCheck --check-prefix=PARSE %s
18 # RUN: not ls bad-lib.a
20 # PARSE: error: script line 2: could not parse library
23 # RUN: not llvm-ar -M < no-create.mri 2>&1 | FileCheck --check-prefix=NOCREATE %s
25 # NOCREATE: error: script line 1: no output archive has been opened
27 ## ADDLIB with missing file.
28 # RUN: not llvm-ar -M < missing.mri 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=MISSING
29 # RUN: not ls missing.a
31 # MISSING: error: script line 2: could not open library missing-lib.a: [[MSG]]
33 ## ADD same lib twice.
34 # RUN: llvm-ar -M < duplicate.mri
35 # RUN: llvm-nm --print-armap duplicate.a | FileCheck --check-prefix=SYMS2 %s
36 # RUN: llvm-ar t duplicate.a | FileCheck --check-prefix=FILES2 %s
38 # SYMS2-COUNT-2: f in {{.*}}