1## Test the ADDMOD MRI command. 2 3# RUN: rm -rf %t && split-file %s %t 4# RUN: cd %t 5# RUN: yaml2obj %s -o f.o 6 7# RUN: llvm-ar -M < add-mod.mri 8# RUN: llvm-nm --print-armap add-mod.a | FileCheck --check-prefix=SYMS %s 9# RUN: llvm-ar t add-mod.a | FileCheck --check-prefix=FILES %s 10 11# SYMS: f in {{.*}} 12# FILES: f.o 13 14## No create command. 15# RUN: not llvm-ar -M < no-create.mri 2>&1 | FileCheck --check-prefix=NOCREATE %s 16 17# NOCREATE: error: script line 1: no output archive has been opened 18 19## ADDMOD with missing file. 20# RUN: not llvm-ar -M < missing.mri 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=MISSING 21# RUN: not ls missing.a 22 23# MISSING: error: script line 2: missing.o: [[MSG]] 24 25## ADD same file twice. 26# RUN: llvm-ar -M < duplicate.mri 27# RUN: llvm-nm --print-armap duplicate.a | FileCheck --check-prefix=SYMS2 %s 28# RUN: llvm-ar t duplicate.a | FileCheck --check-prefix=FILES2 %s 29 30# SYMS2-COUNT-2: f in {{.*}} 31# FILES2-COUNT-2: f.o 32 33#--- f.yaml 34--- !ELF 35FileHeader: 36 Class: ELFCLASS64 37 Data: ELFDATA2LSB 38 Type: ET_REL 39 Machine: EM_X86_64 40Sections: 41 - Name: .text 42 Type: SHT_PROGBITS 43Symbols: 44 - Name: f 45 Binding: STB_GLOBAL 46 Section: .text 47... 48#--- add-mod.mri 49CREATE add-mod.a 50ADDMOD f.o 51SAVE 52 53#--- no-create.mri 54ADDMOD f.o 55SAVE 56 57#--- missing.mri 58CREATE missing.a 59ADDMOD missing.o 60SAVE 61 62#--- duplicate.mri 63CREATE duplicate.a 64ADDMOD f.o 65ADDMOD f.o 66SAVE 67