-; RUN: llc < %s -filetype=obj -mtriple=thumbv6-apple-darwin -o - | macho-dump --dump-section-data | FileCheck -check-prefix=CHECK-T1 %s
-; RUN: llc < %s -filetype=obj -mtriple=thumbv7-apple-darwin -o - | macho-dump --dump-section-data | FileCheck -check-prefix=CHECK-T2 %s
-; RUN: llc < %s -filetype=obj -mtriple=armv6-apple-darwin -o - | macho-dump --dump-section-data | FileCheck -check-prefix=CHECK-ARM %s
-; RUN: llc < %s -filetype=obj -mtriple=armv7-apple-darwin -o - | macho-dump --dump-section-data | FileCheck -check-prefix=CHECK-ARMV7 %s
+; RUN: llc < %s -filetype=obj -mtriple=thumbv6-apple-darwin -o - | llvm-readobj -s -sd | FileCheck -check-prefix=CHECK-T1 %s
+; RUN: llc < %s -filetype=obj -mtriple=thumbv7-apple-darwin -o - | llvm-readobj -s -sd | FileCheck -check-prefix=CHECK-T2 %s
+; RUN: llc < %s -filetype=obj -mtriple=armv6-apple-darwin -o - | llvm-readobj -s -sd | FileCheck -check-prefix=CHECK-ARM %s
+; RUN: llc < %s -filetype=obj -mtriple=armv7-apple-darwin -o - | llvm-readobj -s -sd | FileCheck -check-prefix=CHECK-ARMV7 %s
; Empty functions need a NOP in them for MachO to prevent DWARF FDEs from
; getting all mucked up. See lib/CodeGen/AsmPrinter/AsmPrinter.cpp for
define internal fastcc void @empty_function() {
unreachable
}
-; CHECK-T1: ('_section_data', 'c046')
-; CHECK-T2: ('_section_data', '00bf')
-; CHECK-ARM: ('_section_data', '0000a0e1')
-; CHECK-ARMV7: ('_section_data', '00f020e3')
+; CHECK-T1: SectionData (
+; CHECK-T1: 0000: C046 |.F|
+; CHECK-T1: )
+; CHECK-T2: SectionData (
+; CHECK-T2: 0000: 00BF |..|
+; CHECK-T2: )
+; CHECK-ARM: SectionData (
+; CHECK-ARM: 0000: 0000A0E1 |....|
+; CHECK-ARM: )
+; CHECK-ARMV7: SectionData (
+; CHECK-ARMV7: 0000: 00F020E3 |.. .|
+; CHECK-ARMV7: )
@ RUN: llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o %t.o
-@ RUN: macho-dump --dump-section-data < %t.o | FileCheck %s
+@ RUN: llvm-readobj -relocations -expand-relocs < %t.o | FileCheck %s
@ rdar://12359919
pop {r7, pc}
-@ CHECK: ('_relocations', [
-@ CHECK: # Relocation 0
-@ CHECK: (('word-0', 0x4),
-@ CHECK: ('word-1', 0x6d000002)),
-@ CHECK: ])
+@ CHECK: File: <stdin>
+@ CHECK: Format: Mach-O arm
+@ CHECK: Arch: arm
+@ CHECK: AddressSize: 32bit
+@ CHECK: Relocations [
+@ CHECK: Section __text {
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x4
+@ CHECK: PCRel: 1
+@ CHECK: Length: 2
+@ CHECK: Type: ARM_THUMB_RELOC_BR22 (6)
+@ CHECK: Symbol: _foo (2)
+@ CHECK: }
+@ CHECK: }
+@ CHECK: ]
@ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -s -sd < %t.obj > %t.dump
@ RUN: FileCheck < %t.dump %s
@ When not using subsections-via-symbols, references to non-local symbols
bar:
.long 0
-@ CHECK: 'num_reloc', 0
-@ CHECK: '_section_data', 'dff80030 00000000'
+@ CHECK: RelocationCount: 0
+@ CHECK: SectionData (
+@ CHECK: 0000: DFF80030 00000000 |...0....|
+@ CHECK: )
@ RUN: llvm-mc -triple armv4-apple-darwin %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -s -sd < %t.obj > %t.dump
@ RUN: FileCheck %s < %t.dump
x:
.align 4
add r0, r1, r2
-@ CHECK: ('_section_data', '020081e0 0000a0e1 0000a0e1 0000a0e1 020081e0')
+@ CHECK: SectionData (
+@ CHECK: 0000: 020081E0 0000A0E1 0000A0E1 0000A0E1 |................|
+@ CHECK: 0010: 020081E0 |....|
+@ CHECK: )
@ RUN: llvm-mc -triple armv6t2-apple-darwin %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -s -sd < %t.obj > %t.dump
@ RUN: FileCheck %s < %t.dump
x:
.align 4
add r0, r1, r2
-@ CHECK: ('_section_data', '020081e0 00f020e3 00f020e3 00f020e3 020081e0')
+@ CHECK: SectionData (
+@ CHECK: 0000: 020081E0 00F020E3 00F020E3 00F020E3 |...... ... ... .|
+@ CHECK: 0010: 020081E0 |....|
+@ CHECK: )
@ RUN: llvm-mc -triple armv6-apple-darwin %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -s -sd < %t.obj > %t.dump
@ RUN: FileCheck %s < %t.dump
.thumb_func x
.align 4
adds r0, r1, r2
-@ CHECK: ('_section_data', '8818c046 c046c046 c046c046 c046c046 8818')
+@ CHECK: SectionData (
+@ CHECK: 0000: 8818C046 C046C046 C046C046 C046C046 |...F.F.F.F.F.F.F|
+@ CHECK: 0010: 8818 |..|
+@ CHECK: )
@ RUN: llvm-mc -triple armv7-apple-darwin %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -s -sd < %t.obj > %t.dump
@ RUN: FileCheck %s < %t.dump
.thumb_func x
.align 4
adds r0, r1, r2
-@ CHECK: ('_section_data', '881800bf 00bf00bf 00bf00bf 00bf00bf 8818')
+@ CHECK: SectionData (
+@ CHECK: 0000: 881800BF 00BF00BF 00BF00BF 00BF00BF |................|
+@ CHECK: 0010: 8818 |..|
+@ CHECK: )
@ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -s -sd < %t.obj > %t.dump
@ RUN: FileCheck < %t.dump %s
.syntax unified
_foo:
ldr r2, (_foo - 4)
-@ CHECK: ('num_reloc', 0)
-@ CHECK: ('_section_data', '5ff80820')
+@ CHECK: RelocationCount: 0
+@ CHECK: Type: 0x0
+@ CHECK: Attributes [ (0x800004)
+@ CHECK: PureInstructions (0x800000)
+@ CHECK: SomeInstructions (0x4)
+@ CHECK: ]
+@ CHECK: Reserved1: 0x0
+@ CHECK: Reserved2: 0x0
+@ CHECK: SectionData (
+@ CHECK: 0000: 5FF80820 |_.. |
+@ CHECK: )
-@ RUN: llvm-mc -triple=thumbv7-apple-darwin -show-encoding %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -show-encoding %s -filetype=obj -o - | llvm-readobj -s -sd | FileCheck %s
ble Lfoo @ wide encoding
.space 256
Lbaz:
-@ CHECK: '_section_data', '40f38180
-@ CHECK: 000000bf 7fdd
+@ CHECK: SectionData (
+@ CHECK: 0000: 40F38180 00000000 00000000 00000000 |@...............|
+@ CHECK: 0010: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0020: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0030: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0040: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0050: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0060: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0070: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0080: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0090: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 00A0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 00B0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 00C0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 00D0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 00E0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 00F0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0100: 00000000 000000BF 7FDD0000 00000000 |................|
+@ CHECK: 0110: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0120: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0130: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0140: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0150: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0160: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0170: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0180: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0190: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 01A0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 01B0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 01C0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 01D0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 01E0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 01F0: 00000000 00000000 00000000 00000000 |................|
+@ CHECK: 0200: 00000000 00000000 0000 |..........|
+@ CHECK: )
@ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -s -sd < %t.obj > %t.dump
@ RUN: FileCheck < %t.dump %s
.syntax unified
.text
.subsections_via_symbols
-@ CHECK: ('_section_data', '5ff808e0')
+@ CHECK: SectionData (
+@ CHECK: 0000: 5FF808E0 |_...|
+@ CHECK: )
-@ RUN: llvm-mc -mcpu=cortex-a8 -triple thumbv7-apple-darwin10 -filetype=obj -o - < %s | macho-dump | FileCheck %s
+@ RUN: llvm-mc -mcpu=cortex-a8 -triple thumbv7-apple-darwin10 -filetype=obj -o - < %s | llvm-readobj -relocations -expand-relocs | FileCheck %s
_fred:
movt r3, :upper16:(_wilma-(LPC0_0+4))
_wilma:
.long 0
-@ CHECK: ('_relocations', [
-@ CHECK: # Relocation 0
-@ CHECK: (('word-0', 0xb9000000),
-@ CHECK: ('word-1', 0x4)),
-@ CHECK: # Relocation 1
-@ CHECK: (('word-0', 0xb100fffc),
-@ CHECK: ('word-1', 0x4)),
-
+@ CHECK: File: <stdin>
+@ CHECK: Format: Mach-O arm
+@ CHECK: Arch: arm
+@ CHECK: AddressSize: 32bit
+@ CHECK: Relocations [
+@ CHECK: Section __text {
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x0
+@ CHECK: PCRel: 0
+@ CHECK: Length: 3
+@ CHECK: Type: ARM_RELOC_HALF_SECTDIFF (9)
+@ CHECK: Value: 0x4
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0xFFFC
+@ CHECK: PCRel: 0
+@ CHECK: Length: 3
+@ CHECK: Type: ARM_RELOC_PAIR (1)
+@ CHECK: Value: 0x4
+@ CHECK: }
+@ CHECK: }
+@ CHECK: ]
-@ RUN: llvm-mc -mcpu=cortex-a8 -triple thumbv7-apple-darwin10 -filetype=obj -o - < %s | macho-dump | FileCheck %s
+@ RUN: llvm-mc -mcpu=cortex-a8 -triple thumbv7-apple-darwin10 -filetype=obj -o - < %s | llvm-readobj -relocations -expand-relocs | FileCheck %s
@ rdar://10038370
L1: .long 0
L2: .long 0
-@ CHECK: ('_relocations', [
-@ CHECK: # Relocation 0
-@ CHECK: (('word-0', 0xc),
-@ CHECK: ('word-1', 0x86000002)),
-@ CHECK: # Relocation 1
-@ CHECK: (('word-0', 0x1184),
-@ CHECK: ('word-1', 0x16ffffff)),
-@ CHECK: # Relocation 2
-@ CHECK: (('word-0', 0x8),
-@ CHECK: ('word-1', 0x84000002)),
-@ CHECK: # Relocation 3
-@ CHECK: (('word-0', 0x1),
-@ CHECK: ('word-1', 0x14ffffff)),
-@ CHECK: # Relocation 4
-@ CHECK: (('word-0', 0x4),
-@ CHECK: ('word-1', 0x86000002)),
-@ CHECK: # Relocation 5
-@ CHECK: (('word-0', 0x1180),
-@ CHECK: ('word-1', 0x16ffffff)),
-@ CHECK: # Relocation 6
-@ CHECK: (('word-0', 0x0),
-@ CHECK: ('word-1', 0x84000002)),
-@ CHECK: # Relocation 7
-@ CHECK: (('word-0', 0x1),
-@ CHECK: ('word-1', 0x14ffffff)),
+@ CHECK: Format: Mach-O arm
+@ CHECK: Arch: arm
+@ CHECK: AddressSize: 32bit
+@ CHECK: Relocations [
+@ CHECK: Section __text {
+@ CHECK: Relocation {
+@ CHECK: Offset: 0xC
+@ CHECK: PCRel: 0
+@ CHECK: Length: 3
+@ CHECK: Type: ARM_RELOC_HALF (8)
+@ CHECK: Section: __data (2)
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x1184
+@ CHECK: PCRel: 0
+@ CHECK: Length: 3
+@ CHECK: Type: ARM_RELOC_PAIR (1)
+@ CHECK: Section: - (16777215)
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x8
+@ CHECK: PCRel: 0
+@ CHECK: Length: 2
+@ CHECK: Type: ARM_RELOC_HALF (8)
+@ CHECK: Section: __data (2)
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x1
+@ CHECK: PCRel: 0
+@ CHECK: Length: 2
+@ CHECK: Type: ARM_RELOC_PAIR (1)
+@ CHECK: Section: - (16777215)
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x4
+@ CHECK: PCRel: 0
+@ CHECK: Length: 3
+@ CHECK: Type: ARM_RELOC_HALF (8)
+@ CHECK: Section: __data (2)
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x1180
+@ CHECK: PCRel: 0
+@ CHECK: Length: 3
+@ CHECK: Type: ARM_RELOC_PAIR (1)
+@ CHECK: Section: - (16777215)
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x0
+@ CHECK: PCRel: 0
+@ CHECK: Length: 2
+@ CHECK: Type: ARM_RELOC_HALF (8)
+@ CHECK: Section: __data (2)
+@ CHECK: }
+@ CHECK: Relocation {
+@ CHECK: Offset: 0x1
+@ CHECK: PCRel: 0
+@ CHECK: Length: 2
+@ CHECK: Type: ARM_RELOC_PAIR (1)
+@ CHECK: Section: - (16777215)
+@ CHECK: }
+@ CHECK: }
+@ CHECK: ]