summaryrefslogtreecommitdiffstats
path: root/test/tools/llvm-readobj/file-headers.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/tools/llvm-readobj/file-headers.test')
-rw-r--r--test/tools/llvm-readobj/file-headers.test122
1 files changed, 116 insertions, 6 deletions
diff --git a/test/tools/llvm-readobj/file-headers.test b/test/tools/llvm-readobj/file-headers.test
index 39a8c0e..fd030ef 100644
--- a/test/tools/llvm-readobj/file-headers.test
+++ b/test/tools/llvm-readobj/file-headers.test
@@ -10,6 +10,16 @@ RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-i386 \
RUN: | FileCheck %s -check-prefix ELF32
RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-x86-64 \
RUN: | FileCheck %s -check-prefix ELF64
+RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-i386 \
+RUN: | FileCheck %s -check-prefix MACHO32
+RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-x86-64 \
+RUN: | FileCheck %s -check-prefix MACHO64
+RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-ppc \
+RUN: | FileCheck %s -check-prefix MACHO-PPC
+RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-ppc64 \
+RUN: | FileCheck %s -check-prefix MACHO-PPC64
+RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-arm \
+RUN: | FileCheck %s -check-prefix MACHO-ARM
RUN: llvm-readobj -h %p/Inputs/magic.coff-unknown \
RUN: | FileCheck %s -check-prefix COFF-UNKNOWN
RUN: llvm-readobj -h %p/Inputs/magic.coff-importlib \
@@ -122,6 +132,88 @@ ELF64-NEXT: SectionHeaderCount: 10
ELF64-NEXT: StringTableSectionIndex: 7
ELF64-NEXT: }
+MACHO32: File: {{(.*[/\\])?}}trivial.obj.macho-i386
+MACHO32-NEXT: Format: Mach-O 32-bit i386
+MACHO32-NEXT: Arch: i386
+MACHO32-NEXT: AddressSize: 32bit
+MACHO32-NEXT: MachHeader {
+MACHO32-NEXT: Magic: Magic (0xFEEDFACE)
+MACHO32-NEXT: CpuType: X86 (0x7)
+MACHO32-NEXT: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
+MACHO32-NEXT: FileType: Relocatable (0x1)
+MACHO32-NEXT: NumOfLoadCommands: 3
+MACHO32-NEXT: SizeOfLoadCommands: 296
+MACHO32-NEXT: Flags [ (0x2000)
+MACHO32-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
+MACHO32-NEXT: ]
+MACHO32-NEXT: }
+
+MACHO64: File: {{(.*[/\\])?}}trivial.obj.macho-x86-64
+MACHO64-NEXT: Format: Mach-O 64-bit x86-64
+MACHO64-NEXT: Arch: x86_64
+MACHO64-NEXT: AddressSize: 64bit
+MACHO64-NEXT: MachHeader {
+MACHO64-NEXT: Magic: Magic64 (0xFEEDFACF)
+MACHO64-NEXT: CpuType: X86-64 (0x1000007)
+MACHO64-NEXT: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3)
+MACHO64-NEXT: FileType: Relocatable (0x1)
+MACHO64-NEXT: NumOfLoadCommands: 3
+MACHO64-NEXT: SizeOfLoadCommands: 336
+MACHO64-NEXT: Flags [ (0x2000)
+MACHO64-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
+MACHO64-NEXT: ]
+MACHO64-NEXT: Reserved: 0x0
+MACHO64-NEXT: }
+
+MACHO-PPC: File: {{(.*[/\\])?}}trivial.obj.macho-ppc
+MACHO-PPC-NEXT: Format: Mach-O 32-bit ppc
+MACHO-PPC-NEXT: Arch: powerpc
+MACHO-PPC-NEXT: AddressSize: 32bit
+MACHO-PPC-NEXT: MachHeader {
+MACHO-PPC-NEXT: Magic: Magic (0xFEEDFACE)
+MACHO-PPC-NEXT: CpuType: PowerPC (0x12)
+MACHO-PPC-NEXT: CpuSubType: CPU_SUBTYPE_POWERPC_ALL (0x0)
+MACHO-PPC-NEXT: FileType: Relocatable (0x1)
+MACHO-PPC-NEXT: NumOfLoadCommands: 3
+MACHO-PPC-NEXT: SizeOfLoadCommands: 500
+MACHO-PPC-NEXT: Flags [ (0x2000)
+MACHO-PPC-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
+MACHO-PPC-NEXT: ]
+MACHO-PPC-NEXT: }
+
+MACHO-PPC64: File: {{(.*[/\\])?}}trivial.obj.macho-ppc64
+MACHO-PPC64-NEXT: Format: Mach-O 64-bit ppc64
+MACHO-PPC64-NEXT: Arch: powerpc64
+MACHO-PPC64-NEXT: AddressSize: 64bit
+MACHO-PPC64-NEXT: MachHeader {
+MACHO-PPC64-NEXT: Magic: Magic64 (0xFEEDFACF)
+MACHO-PPC64-NEXT: CpuType: PowerPC64 (0x1000012)
+MACHO-PPC64-NEXT: CpuSubtype: 0x0
+MACHO-PPC64-NEXT: FileType: Relocatable (0x1)
+MACHO-PPC64-NEXT: NumOfLoadCommands: 3
+MACHO-PPC64-NEXT: SizeOfLoadCommands: 576
+MACHO-PPC64-NEXT: Flags [ (0x2000)
+MACHO-PPC64-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
+MACHO-PPC64-NEXT: ]
+MACHO-PPC64-NEXT: Reserved: 0x0
+MACHO-PPC64-NEXT: }
+
+MACHO-ARM: File: {{(.*[/\\])?}}trivial.obj.macho-arm
+MACHO-ARM-NEXT: Format: Mach-O arm
+MACHO-ARM-NEXT: Arch: arm
+MACHO-ARM-NEXT: AddressSize: 32bit
+MACHO-ARM-NEXT: MachHeader {
+MACHO-ARM-NEXT: Magic: Magic (0xFEEDFACE)
+MACHO-ARM-NEXT: CpuType: Arm (0xC)
+MACHO-ARM-NEXT: CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9)
+MACHO-ARM-NEXT: FileType: Relocatable (0x1)
+MACHO-ARM-NEXT: NumOfLoadCommands: 3
+MACHO-ARM-NEXT: SizeOfLoadCommands: 636
+MACHO-ARM-NEXT: Flags [ (0x2000)
+MACHO-ARM-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
+MACHO-ARM-NEXT: ]
+MACHO-ARM-NEXT: }
+
PE32: File: {{(.*[/\\])?}}trivial.exe.coff-i386
PE32-NEXT: Format: COFF-i386
PE32-NEXT: Arch: i386
@@ -159,7 +251,7 @@ PE32-NEXT: MinorSubsystemVersion: 0
PE32-NEXT: SizeOfImage: 16384
PE32-NEXT: SizeOfHeaders: 1024
PE32-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
-PE32-NEXT: Subsystem [ (0x8140)
+PE32-NEXT: Characteristics [ (0x8140)
PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
@@ -204,6 +296,25 @@ PE32-NEXT: ReservedRVA: 0x0
PE32-NEXT: ReservedSize: 0x0
PE32-NEXT: }
PE32-NEXT: }
+PE32-NEXT: DOSHeader {
+PE32-NEXT: Magic: MZ
+PE32-NEXT: UsedBytesInTheLastPage: 144
+PE32-NEXT: FileSizeInPages: 3
+PE32-NEXT: NumberOfRelocationItems: 0
+PE32-NEXT: HeaderSizeInParagraphs: 4
+PE32-NEXT: MinimumExtraParagraphs: 0
+PE32-NEXT: MaximumExtraParagraphs: 65535
+PE32-NEXT: InitialRelativeSS: 0
+PE32-NEXT: InitialSP: 184
+PE32-NEXT: Checksum: 0
+PE32-NEXT: InitialIP: 0
+PE32-NEXT: InitialRelativeCS: 0
+PE32-NEXT: AddressOfRelocationTable: 64
+PE32-NEXT: OverlayNumber: 0
+PE32-NEXT: OEMid: 0
+PE32-NEXT: OEMinfo: 0
+PE32-NEXT: AddressOfNewExeHeader: 176
+PE32-NEXT: }
COFF-UNKNOWN: Format: COFF-<unknown arch>
COFF-UNKNOWN-NEXT: Arch: unknown
@@ -224,12 +335,11 @@ COFF-IMPORTLIB-NEXT: Arch: unknown
COFF-IMPORTLIB-NEXT: AddressSize: 32bit
COFF-IMPORTLIB-NEXT: ImageFileHeader {
COFF-IMPORTLIB-NEXT: Machine: IMAGE_FILE_MACHINE_UNKNOWN (0x0)
-COFF-IMPORTLIB-NEXT: SectionCount: 65535
+COFF-IMPORTLIB-NEXT: SectionCount: 0
COFF-IMPORTLIB-NEXT: TimeDateStamp: 1970-09-09 19:52:32 (0x14C0000)
-COFF-IMPORTLIB-NEXT: PointerToSymbolTable: 0x528542EB
-COFF-IMPORTLIB-NEXT: SymbolCount: 20
+COFF-IMPORTLIB-NEXT: PointerToSymbolTable: 0x0
+COFF-IMPORTLIB-NEXT: SymbolCount: 0
COFF-IMPORTLIB-NEXT: OptionalHeaderSize: 0
-COFF-IMPORTLIB-NEXT: Characteristics [ (0x8)
-COFF-IMPORTLIB-NEXT: IMAGE_FILE_LOCAL_SYMS_STRIPPED (0x8)
+COFF-IMPORTLIB-NEXT: Characteristics [ (0x0)
COFF-IMPORTLIB-NEXT: ]
COFF-IMPORTLIB-NEXT: }