101 lines · plain
1## Test how we dump archives.2 3## Show that dumping operations apply to all members in an archive.4 5# RUN: rm -f %t.a6# RUN: rm -rf %t.dir7# RUN: mkdir -p %t.dir8# RUN: yaml2obj --docnum=1 %s -o %t.dir/trivial.obj.elf-x86-649# RUN: yaml2obj --docnum=2 %s -o %t.dir/trivial.obj.elf-i38610# RUN: yaml2obj --docnum=3 %s -o %t.dir/trivial.obj.coff-arm11 12# RUN: llvm-ar rc %t.a %t.dir/trivial.obj.elf-x86-64 %t.dir/trivial.obj.elf-i386 %t.dir/trivial.obj.coff-arm13# RUN: llvm-readobj --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=LLVM,COFF14# RUN: llvm-readelf --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=GNU,COFF15 16# LLVM: {{^$}}17# LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)18# LLVM: Format: elf64-x86-6419# LLVM: ElfHeader {20# LLVM: Machine: EM_X86_6421# LLVM: Sections [22# LLVM: Relocations [23# LLVM: Symbols [24# LLVM: NoteSections [25# LLVM: ]26# LLVM: StackSizes [27# LLVM: ]28 29# GNU: {{^$}}30# GNU-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)31# GNU: ELF Header:32# GNU: Machine: Advanced Micro Devices X86-6433# GNU: Section Headers:34# GNU: There are no section groups in this file.35 36# LLVM-EMPTY:37# LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-i386)38# LLVM: Format: elf32-i38639# LLVM: ElfHeader {40# LLVM: Machine: EM_38641# LLVM: Sections [42# LLVM: Relocations [43# LLVM: Symbols [44# LLVM: NoteSections [45# LLVM: ]46# LLVM: StackSizes [47# LLVM: ]48 49# GNU-EMPTY:50# GNU-NEXT: File: [[ARFILE]](trivial.obj.elf-i386)51# GNU: ELF Header:52# GNU: Machine: Intel 8038653# GNU: Section Headers:54# GNU: There are no section groups in this file.55 56# LLVM-EMPTY:57# LLVM-NEXT: File: [[ARFILE]](trivial.obj.coff-arm)58# LLVM: Format: COFF-ARM59# GNU-EMPTY:60# GNU-NEXT: File: [[ARFILE]](trivial.obj.coff-arm)61# COFF: ImageFileHeader {62# COFF: Machine: IMAGE_FILE_MACHINE_ARMNT63# COFF: Sections [64# COFF: Relocations [65# COFF: Symbols [66 67--- !ELF68FileHeader:69 Class: ELFCLASS6470 Data: ELFDATA2LSB71 Type: ET_REL72 Machine: EM_X86_6473 74--- !ELF75FileHeader:76 Class: ELFCLASS3277 Data: ELFDATA2LSB78 Type: ET_REL79 Machine: EM_38680 81--- !COFF82header:83 Machine: IMAGE_FILE_MACHINE_ARMNT84 Characteristics: [ ]85sections: []86symbols: []87 88## Here we test that we report a warning and continue dumping when an archive contains89## an unrecognized object. We add a dummy archive to the middle of another archive,90## so that it is between two valid objects.91 92# RUN: rm -f %t2.a93# RUN: llvm-ar rc %t.dir/broken.a %t.dir/trivial.obj.elf-x86-6494# RUN: llvm-ar qc %t2.a %t.dir/trivial.obj.elf-x86-64 %t.dir/broken.a %t.dir/trivial.obj.elf-x86-6495# RUN: llvm-readobj --all %t2.a 2>&1 | FileCheck %s -DARFILE="%t2.a" --check-prefix=BROKEN96# RUN: llvm-readelf --all %t2.a 2>&1 | FileCheck %s -DARFILE="%t2.a" --check-prefix=BROKEN97 98# BROKEN: File: [[ARFILE]](trivial.obj.elf-x86-64)99# BROKEN: warning: '[[ARFILE]]': broken.a has an unsupported file type100# BROKEN: File: [[ARFILE]](trivial.obj.elf-x86-64)101