1 ## Test how we dump archives.
3 ## Show that dumping operations apply to all members in an archive.
8 # RUN: yaml2obj --docnum=1 %s -o %t.dir/trivial.obj.elf-x86-64
9 # RUN: yaml2obj --docnum=2 %s -o %t.dir/trivial.obj.elf-i386
10 # RUN: yaml2obj --docnum=3 %s -o %t.dir/trivial.obj.coff-arm
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-arm
13 # RUN: llvm-readobj --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=LLVM,COFF
14 # RUN: llvm-readelf --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=GNU,COFF
17 # LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)
18 # LLVM: Format: elf64-x86-64
20 # LLVM: Machine: EM_X86_64
24 # LLVM: NoteSections [
30 # GNU-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)
32 # GNU: Machine: Advanced Micro Devices X86-64
33 # GNU: Section Headers:
34 # GNU: There are no section groups in this file.
37 # LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-i386)
38 # LLVM: Format: elf32-i386
40 # LLVM: Machine: EM_386
44 # LLVM: NoteSections [
50 # GNU-NEXT: File: [[ARFILE]](trivial.obj.elf-i386)
52 # GNU: Machine: Intel 80386
53 # GNU: Section Headers:
54 # GNU: There are no section groups in this file.
57 # LLVM-NEXT: File: [[ARFILE]](trivial.obj.coff-arm)
58 # LLVM: Format: COFF-ARM
60 # GNU-NEXT: File: [[ARFILE]](trivial.obj.coff-arm)
61 # COFF: ImageFileHeader {
62 # COFF: Machine: IMAGE_FILE_MACHINE_ARMNT
83 Machine: IMAGE_FILE_MACHINE_ARMNT
88 ## Here we test that we report a warning and continue dumping when an archive contains
89 ## an unrecognized object. We add a dummy archive to the middle of another archive,
90 ## so that it is between two valid objects.
93 # RUN: llvm-ar rc %t.dir/broken.a %t.dir/trivial.obj.elf-x86-64
94 # RUN: llvm-ar qc %t2.a %t.dir/trivial.obj.elf-x86-64 %t.dir/broken.a %t.dir/trivial.obj.elf-x86-64
95 # RUN: llvm-readobj --all %t2.a 2>&1 | FileCheck %s -DARFILE="%t2.a" --check-prefix=BROKEN
96 # RUN: llvm-readelf --all %t2.a 2>&1 | FileCheck %s -DARFILE="%t2.a" --check-prefix=BROKEN
98 # BROKEN: File: [[ARFILE]](trivial.obj.elf-x86-64)
99 # BROKEN: warning: '[[ARFILE]]': broken.a has an unsupported file type
100 # BROKEN: File: [[ARFILE]](trivial.obj.elf-x86-64)