+++ /dev/null
-## Test the ADDLIB MRI command.\r
-\r
-# RUN: rm -rf %t && mkdir -p %t\r
-# RUN: yaml2obj %s -o %t/f.o\r
-# RUN: llvm-ar r %t/f.a %t/f.o\r
-\r
-## Merge contents of archives.\r
-# RUN: echo "CREATE %t/addlib.a" > %t/addlib.mri\r
-# RUN: echo "ADDLIB %t/f.a" >> %t/addlib.mri\r
-# RUN: echo "SAVE" >> %t/addlib.mri\r
-# RUN: llvm-ar -M < %t/addlib.mri\r
-# RUN: llvm-nm --print-armap %t/addlib.a | FileCheck --check-prefix=SYMS %s\r
-# RUN: llvm-ar t %t/addlib.a | FileCheck --check-prefix=FILES %s\r
-\r
-# SYMS: f in {{.*}}\r
-# FILES: f.o\r
-\r
-## ADDLIB with non-archive file.\r
-# RUN: echo "CREATE %t/badlib.a" > %t/badlib.mri\r
-# RUN: echo "ADDLIB %s" >> %t/badlib.mri\r
-# RUN: echo "SAVE" >> %t/badlib.mri\r
-# RUN: not llvm-ar -M < %t/badlib.mri 2>&1 | FileCheck --check-prefix=PARSE %s\r
-# RUN: not ls %t/badlib.a\r
-\r
-# PARSE: Could not parse library\r
-\r
-## No create command.\r
-# RUN: echo "ADDLIB %t/f.a" > %t/nocreate.mri\r
-# RUN: echo "SAVE" >> %t/nocreate.mri\r
-# RUN: not llvm-ar -M < %t/nocreate.mri\r
-\r
---- !ELF\r
-FileHeader:\r
- Class: ELFCLASS64\r
- Data: ELFDATA2LSB\r
- Type: ET_REL\r
- Machine: EM_X86_64\r
-Sections:\r
- - Name: .text\r
- Type: SHT_PROGBITS\r
-Symbols:\r
- - Name: f\r
- Binding: STB_GLOBAL\r
- Section: .text\r
-...\r
+++ /dev/null
-## Test the ADDMOD MRI command.\r
-\r
-# RUN: rm -rf %t && mkdir -p %t\r
-# RUN: yaml2obj %s -o %t/f.o\r
-\r
-# RUN: echo "CREATE %t/addmod.a" > %t/addmod.mri\r
-# RUN: echo "ADDMOD %t/f.o" >> %t/addmod.mri\r
-# RUN: echo "SAVE" >> %t/addmod.mri\r
-# RUN: llvm-ar -M < %t/addmod.mri\r
-# RUN: llvm-nm --print-armap %t/addmod.a | FileCheck %s\r
-\r
-# CHECK: f in f.o\r
-\r
---- !ELF\r
-FileHeader:\r
- Class: ELFCLASS64\r
- Data: ELFDATA2LSB\r
- Type: ET_REL\r
- Machine: EM_X86_64\r
-Sections:\r
- - Name: .text\r
- Type: SHT_PROGBITS\r
-Symbols:\r
- - Name: f\r
- Binding: STB_GLOBAL\r
- Section: .text\r
-...\r
+++ /dev/null
-# Test different MRI comment formats and white space.\r
-\r
-RUN: rm -rf %t && mkdir -p %t\r
-RUN: yaml2obj %S/Inputs/elf.yaml -o %t/elf.o\r
-\r
-RUN: echo "create %t/mri.ar;comment" > %t/script.mri\r
-RUN: echo "addmod %t/elf.o * comment" >> %t/script.mri\r
-RUN: echo "; comment" >> %t/script.mri\r
-RUN: echo " ;comment" >> %t/script.mri\r
-RUN: echo "* comment" >> %t/script.mri\r
-RUN: echo " *comment" >> %t/script.mri\r
-RUN: echo "" >> %t/script.mri\r
-RUN: echo " " >> %t/script.mri\r
-RUN: echo " save" >> %t/script.mri\r
-\r
-RUN: llvm-ar -M < %t/script.mri\r
-RUN: llvm-ar t %t/mri.ar | FileCheck %s\r
-\r
-CHECK: elf.o\r
+++ /dev/null
-# The END MRI command is optional. Scripts that omit\r
-# or include END should be handled by llvm-ar.\r
-RUN: rm -rf %t && mkdir -p %t\r
-\r
-# Empty File\r
-RUN: yaml2obj %S/Inputs/elf.yaml -o %t/elf.o\r
-\r
-RUN: touch %t/empty.mri\r
-RUN: llvm-ar -M < %t/empty.mri\r
-\r
-RUN: echo "END" > %t/empty-end.mri\r
-RUN: llvm-ar -M < %t/empty-end.mri\r
-\r
-# Comment only\r
-RUN: echo "; a comment" > %t/comment.mri\r
-RUN: llvm-ar -M < %t/comment.mri\r
-\r
-RUN: echo "; a comment" > %t/comment-end.mri\r
-RUN: echo "END" > %t/comment-end.mri\r
-RUN: llvm-ar -M < %t/comment-end.mri\r
-\r
-# Without Save\r
-RUN: echo "create %t/mri.ar" > %t/no-save.mri\r
-RUN: echo "addmod %t/elf.o" >> %t/no-save.mri\r
-RUN: llvm-ar -M < %t/no-save.mri\r
-RUN: test ! -e %t/mri.ar\r
-\r
-RUN: echo "create %t/mri.ar" > %t/no-save-end.mri\r
-RUN: echo "addmod %t/elf.o" >> %t/no-save-end.mri\r
-RUN: echo "END" > %t/no-save-end.mri\r
-RUN: llvm-ar -M < %t/no-save-end.mri\r
-RUN: test ! -e %t/mri.ar\r
-\r
-# With Save\r
-RUN: echo "create %t/mri.ar" > %t/save.mri\r
-RUN: echo "addmod %t/elf.o" >> %t/save.mri\r
-RUN: echo "save" >> %t/save.mri\r
-RUN: llvm-ar -M < %t/save.mri\r
-RUN: llvm-ar t %t/mri.ar | FileCheck %s\r
-\r
-RUN: echo "create %t/mri.ar" > %t/save-end.mri\r
-RUN: echo "addmod %t/elf.o" >> %t/save-end.mri\r
-RUN: echo "save" >> %t/save-end.mri\r
-RUN: echo "END" > %t/no-save-end.mri\r
-RUN: llvm-ar -M < %t/save-end.mri\r
-RUN: llvm-ar t %t/mri.ar | FileCheck %s\r
-\r
-CHECK: elf.o\r
+++ /dev/null
-# Test non-ascii archive members
-
-# FIXME: The assertion fails for reasons unknown.
-XFAIL: darwin
-
-RUN: rm -rf %t && mkdir -p %t/extracted
-
-RUN: echo "contents" > %t/£.txt
-
-RUN: echo "CREATE %t/mri.ar" > %t/script.mri
-RUN: echo "ADDMOD %t/£.txt" >> %t/script.mri
-RUN: echo "SAVE" >> %t/script.mri
-
-RUN: llvm-ar -M < %t/script.mri
-RUN: cd %t/extracted && llvm-ar x %t/mri.ar
-
-# This works around problems launching processess that
-# include arguments with non-ascii characters.
-# Python on Linux defaults to ASCII encoding unless the
-# environment specifies otherwise, so it is explicitly set.
-RUN: env LANG=en_US.UTF-8 %python -c "assert open(u'\U000000A3.txt', 'rb').read() == b'contents\n'"