1# The END MRI command is optional. Scripts that omit
2# or include END should be handled by llvm-ar.
3RUN: rm -rf %t && mkdir -p %t
4
5# Empty File
6RUN: yaml2obj %S/Inputs/elf.yaml -o %t/elf.o
7
8RUN: touch %t/empty.mri
9RUN: llvm-ar -M < %t/empty.mri
10
11RUN: echo "END" > %t/empty-end.mri
12RUN: llvm-ar -M < %t/empty-end.mri
13
14# Comment only
15RUN: echo "; a comment" > %t/comment.mri
16RUN: llvm-ar -M < %t/comment.mri
17
18RUN: echo "; a comment" > %t/comment-end.mri
19RUN: echo "END" > %t/comment-end.mri
20RUN: llvm-ar -M < %t/comment-end.mri
21
22# Without Save
23RUN: echo "create %t/mri.ar" > %t/no-save.mri
24RUN: echo "addmod %t/elf.o" >> %t/no-save.mri
25RUN: llvm-ar -M < %t/no-save.mri
26RUN: test ! -e %t/mri.ar
27
28RUN: echo "create %t/mri.ar" > %t/no-save-end.mri
29RUN: echo "addmod %t/elf.o" >> %t/no-save-end.mri
30RUN: echo "END" > %t/no-save-end.mri
31RUN: llvm-ar -M < %t/no-save-end.mri
32RUN: test ! -e %t/mri.ar
33
34# With Save
35RUN: echo "create %t/mri.ar" > %t/save.mri
36RUN: echo "addmod %t/elf.o" >> %t/save.mri
37RUN: echo "save" >> %t/save.mri
38RUN: llvm-ar -M < %t/save.mri
39RUN: llvm-ar t %t/mri.ar | FileCheck %s
40
41RUN: echo "create %t/mri.ar" > %t/save-end.mri
42RUN: echo "addmod %t/elf.o" >> %t/save-end.mri
43RUN: echo "save" >> %t/save-end.mri
44RUN: echo "END" > %t/no-save-end.mri
45RUN: llvm-ar -M < %t/save-end.mri
46RUN: llvm-ar t %t/mri.ar | FileCheck %s
47
48CHECK: elf.o
49