5 # Make copies of the test inputs for placing in the archive so that we can mess
6 # about with them later on.
7 # RUN: cp %p/Inputs/trivial.obj.elf-x86-64 %t/1.o
8 # RUN: cp %p/Inputs/relocs.obj.elf-x86_64 %t/2.o
9 # RUN: cp %p/Inputs/trivial.obj.coff-arm %t/3.o
10 # RUN: llvm-ar rcT %t.a %t/1.o %t/2.o %t/3.o
12 # Test that basic dumping works for all members.
13 # RUN: llvm-readobj --all %t.a | FileCheck %s --check-prefixes=LLVM,COFF
14 # RUN: llvm-readelf --all %t.a | FileCheck %s --check-prefixes=GNU,COFF
16 # LLVM: File: {{.*}}1.o
17 # LLVM: Format: ELF64-x86-64
19 # LLVM: SectionHeaderCount: 10
25 # GNU: Number of section headers: 10
26 # GNU: Section Headers:
27 # GNU: Relocation section '.rela.text'
28 # GNU: Symbol table '.symtab'
30 # LLVM: File: {{.*}}2.o
31 # LLVM: Format: ELF64-x86-64
33 # LLVM: SectionHeaderCount: 8
39 # GNU: Number of section headers: 8
40 # GNU: Section Headers:
41 # GNU: Relocation section '.rela.text'
42 # GNU: Symbol table '.symtab'
44 # LLVM: File: {{.*}}3.o
45 # LLVM: Format: COFF-ARM
46 # COFF: ImageFileHeader {
51 # Overwrite one of the members with a member of a different size to show that
52 # the size field in the member header is not relevant.
54 # RUN: cp %t/1.o %t/2.o
55 # RUN: llvm-readobj --file-headers %t.a | FileCheck %s --check-prefix=RESIZED
57 # RESIZED: File: {{.*}}1.o
58 # RESIZED: SectionHeaderCount: 10
59 # RESIZED: File: {{.*}}2.o
60 # RESIZED: SectionHeaderCount: 10
62 # Remove the second member and show that the first can still be dumped, but that the last isn't.
64 # RUN: not llvm-readobj --file-headers %t.a 2> %t.err | FileCheck %s --check-prefix=MISSING
65 # RUN: FileCheck %s --check-prefix=ERR --input-file=%t.err
67 # MISSING: File: {{.*}}1.o
68 # MISSING: SectionHeaderCount: 10
69 # MISSING-NOT: File: {{.*}}3.o
70 # ERR: error: '{{.*}}.a': '{{.*}}2.o': {{[Nn]}}o such file or directory