Replace elf-dump with llvm-readobj in lld tests

llvm-svn: 179364
This commit is contained in:
Nico Rieck 2013-04-12 04:29:01 +00:00
parent d6df0547fe
commit bdfd4eb223
3 changed files with 100 additions and 77 deletions

View File

@ -1,6 +1,6 @@
RUN: lld -flavor gnu -target hexagon -static -emit-yaml %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon | FileCheck %s -check-prefix hexagon-yaml RUN: lld -flavor gnu -target hexagon -static -emit-yaml %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon | FileCheck %s -check-prefix hexagon-yaml
RUN: lld -flavor gnu -target hexagon -e target -o %t1 %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon RUN: lld -flavor gnu -target hexagon -e target -o %t1 %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon
RUN: elf-dump %t1 | FileCheck -check-prefix=hexagon-elfdump %s RUN: llvm-readobj -h %t1 | FileCheck -check-prefix=hexagon-readobj %s
hexagon-yaml: - name: back hexagon-yaml: - name: back
hexagon-yaml: scope: global hexagon-yaml: scope: global
@ -20,10 +20,13 @@ hexagon-yaml: offset: 0
hexagon-yaml: target: back hexagon-yaml: target: back
hexagon-elfdump: ('e_indent[EI_CLASS]', 0x01) hexagon-readobj: ElfHeader {
hexagon-elfdump: ('e_indent[EI_DATA]', 0x01) hexagon-readobj: Ident {
hexagon-elfdump: ('e_indent[EI_VERSION]', 0x01) hexagon-readobj: Class: 32-bit (0x1)
hexagon-elfdump: ('e_indent[EI_OSABI]', 0x00) hexagon-readobj: DataEncoding: LittleEndian (0x1)
hexagon-elfdump: ('e_indent[EI_ABIVERSION]', 0x00) hexagon-readobj: FileVersion: 1
hexagon-elfdump: ('e_type', 0x0002) hexagon-readobj: OS/ABI: SystemV (0x0)
hexagon-elfdump: ('e_machine', 0x00a4) hexagon-readobj: ABIVersion: 0
hexagon-readobj: }
hexagon-readobj: Type: Executable (0x2)
hexagon-readobj: Machine: EM_HEXAGON (0xA4)

View File

@ -1,69 +1,86 @@
RUN: lld -flavor gnu -target i386-linux -o %t1 -e main %p/Inputs/phdr.i386 \ RUN: lld -flavor gnu -target i386-linux -o %t1 -e main %p/Inputs/phdr.i386 \
RUN: | elf-dump %t1 | FileCheck -check-prefix=ED %s RUN: && llvm-readobj -program-headers %t1 | FileCheck -check-prefix=I386 %s
RUN: lld -flavor gnu -target x86_64-linux -o %t1 -e _start %p/Inputs/relocs.x86-64 -static \ RUN: lld -flavor gnu -target x86_64-linux -o %t1 -e _start %p/Inputs/relocs.x86-64 -static \
RUN: && llvm-objdump -p %t1 | FileCheck %s -check-prefix=X86_64 RUN: && llvm-objdump -p %t1 | FileCheck %s -check-prefix=X86_64
ED: # Program Header 0 I386: ProgramHeaders [
ED: (('p_type', 0x00000006) I386-NEXT: ProgramHeader {
ED: ('p_flags', 0x00000005) I386-NEXT: Type: PT_PHDR (0x6)
ED: ('p_offset', 0x00000034) I386-NEXT: Offset: 0x34
ED: ('p_vaddr', 0x00000034) I386-NEXT: VirtualAddress: 0x34
ED: ('p_paddr', 0x00000034) I386-NEXT: PhysicalAddress: 0x34
ED: ('p_filesz', 0x000000c0) I386-NEXT: FileSize: 192
ED: ('p_memsz', 0x000000c0) I386-NEXT: MemSize: 192
ED: ('p_align', 0x00000008) I386-NEXT: Flags [ (0x5)
ED: ), I386-NEXT: PF_R (0x4)
ED: # Program Header 1 I386-NEXT: PF_X (0x1)
ED: (('p_type', 0x00000003) I386-NEXT: ]
ED: ('p_flags', 0x00000004) I386-NEXT: Alignment: 8
ED: ('p_offset', 0x000000f4) I386-NEXT: }
ED: ('p_vaddr', 0x000000f4) I386-NEXT: ProgramHeader {
ED: ('p_paddr', 0x000000f4) I386-NEXT: Type: PT_INTERP (0x3)
ED: ('p_filesz', 0x0000001c) I386-NEXT: Offset: 0xF4
ED: ('p_memsz', 0x0000001c) I386-NEXT: VirtualAddress: 0xF4
ED: ('p_align', 0x00000001) I386-NEXT: PhysicalAddress: 0xF4
ED: ), I386-NEXT: FileSize: 28
ED: # Program Header 2 I386-NEXT: MemSize: 28
ED: (('p_type', 0x00000001) I386-NEXT: Flags [ (0x4)
ED: ('p_flags', 0x00000005) I386-NEXT: PF_R (0x4)
ED: ('p_offset', 0x00000000) I386-NEXT: ]
ED: ('p_vaddr', 0x00000000) I386-NEXT: Alignment: 1
ED: ('p_paddr', 0x00000000) I386-NEXT: }
ED: ('p_filesz', 0x00000214) I386-NEXT: ProgramHeader {
ED: ('p_memsz', 0x00000214) I386-NEXT: Type: PT_LOAD (0x1)
ED: ('p_align', 0x00001000) I386-NEXT: Offset: 0x0
ED: ), I386-NEXT: VirtualAddress: 0x0
ED: # Program Header 3 I386-NEXT: PhysicalAddress: 0x0
ED: (('p_type', 0x00000001) I386-NEXT: FileSize: 532
ED: ('p_flags', 0x00000006) I386-NEXT: MemSize: 532
ED: ('p_offset', 0x00001000) I386-NEXT: Flags [ (0x5)
ED: ('p_vaddr', 0x00001000) I386-NEXT: PF_R (0x4)
ED: ('p_paddr', 0x00001000) I386-NEXT: PF_X (0x1)
ED: ('p_filesz', 0x00000104) I386-NEXT: ]
ED: ('p_memsz', 0x00000004) I386-NEXT: Alignment: 4096
ED: ('p_align', 0x00001000) I386-NEXT: }
ED: ), I386-NEXT: ProgramHeader {
ED: # Program Header 4 I386-NEXT: Type: PT_LOAD (0x1)
ED: (('p_type', 0x00000001) I386-NEXT: Offset: 0x1000
ED: ('p_flags', 0x00000006) I386-NEXT: VirtualAddress: 0x1000
ED: ('p_offset', 0x00004000) I386-NEXT: PhysicalAddress: 0x1000
ED: ('p_vaddr', 0x00004000) I386-NEXT: FileSize: 260
ED: ('p_paddr', 0x00004000) I386-NEXT: MemSize: 4
ED: ('p_filesz', 0x00000004) I386-NEXT: Flags [ (0x6)
ED: ('p_memsz', 0x00004008) I386-NEXT: PF_R (0x4)
ED: ('p_align', 0x00001000) I386-NEXT: PF_W (0x2)
ED: ), I386-NEXT: ]
ED: # Program Header 5 I386-NEXT: Alignment: 4096
ED: (('p_type', 0x00000002) I386-NEXT: }
ED: ('p_flags', 0x00000004) I386-NEXT: ProgramHeader {
ED: ('p_offset', 0x000001e4) I386-NEXT: Type: PT_LOAD (0x1)
ED: ('p_vaddr', 0x000001e4) I386-NEXT: Offset: 0x4000
ED: ('p_paddr', 0x000001e4) I386-NEXT: VirtualAddress: 0x4000
ED: ('p_filesz', 0x00000030) I386-NEXT: PhysicalAddress: 0x4000
ED: ('p_memsz', 0x00000030) I386-NEXT: FileSize: 4
ED: ('p_align', 0x00000004) I386-NEXT: MemSize: 16392
ED: ), I386-NEXT: Flags [ (0x6)
I386-NEXT: PF_R (0x4)
I386-NEXT: PF_W (0x2)
I386-NEXT: ]
I386-NEXT: Alignment: 4096
I386-NEXT: }
I386-NEXT: ProgramHeader {
I386-NEXT: Type: PT_DYNAMIC (0x2)
I386-NEXT: Offset: 0x1E4
I386-NEXT: VirtualAddress: 0x1E4
I386-NEXT: PhysicalAddress: 0x1E4
I386-NEXT: FileSize: 48
I386-NEXT: MemSize: 48
I386-NEXT: Flags [ (0x4)
I386-NEXT: PF_R (0x4)
I386-NEXT: ]
I386-NEXT: Alignment: 4
I386-NEXT: }
X86_64: LOAD off 0x0000000000000000 X86_64: LOAD off 0x0000000000000000
X86_64: LOAD off 0x0000000000001000 X86_64: LOAD off 0x0000000000001000

View File

@ -1,11 +1,14 @@
RUN: lld -flavor gnu -target powerpc %p/Inputs/branch-test.ppc %p/Inputs/target-test.ppc -o %t1 --noinhibit-exec RUN: lld -flavor gnu -target powerpc %p/Inputs/branch-test.ppc %p/Inputs/target-test.ppc -o %t1 --noinhibit-exec
RUN: elf-dump %t1 | FileCheck -check-prefix=ppc-elfdump %s RUN: llvm-readobj -h %t1 | FileCheck -check-prefix=ppc-readobj %s
ppc-elfdump: ('e_indent[EI_CLASS]', 0x01)
ppc-elfdump: ('e_indent[EI_DATA]', 0x02)
ppc-elfdump: ('e_indent[EI_VERSION]', 0x01)
ppc-elfdump: ('e_indent[EI_OSABI]', 0x00)
ppc-elfdump: ('e_indent[EI_ABIVERSION]', 0x00)
ppc-elfdump: ('e_type', 0x0002)
ppc-elfdump: ('e_machine', 0x0014)
ppc-readobj: ElfHeader {
ppc-readobj: Ident {
ppc-readobj: Class: 32-bit (0x1)
ppc-readobj: DataEncoding: BigEndian (0x2)
ppc-readobj: FileVersion: 1
ppc-readobj: OS/ABI: SystemV (0x0)
ppc-readobj: ABIVersion: 0
ppc-readobj: }
ppc-readobj: Type: Executable (0x2)
ppc-readobj: Machine: EM_PPC (0x14)