llvm/test/MC/MachO/data.s
Davide Italiano 399a0d8bc1 [MC] Convert all the remaining tests from macho-dump to llvm-readobj.
This sort-of deprecates macho-dump. It may take still a little while
to garbage collect it, but at least there's no real usage of it in
the tree anymore. New tests should always rely on llvm-readobj or
llvm-objdump.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247235 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 01:50:00 +00:00

81 lines
2.4 KiB
ArmAsm

// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -file-headers -s -macho-segment | FileCheck %s
.data
.ascii "hello"
.byte 0xAB
.short 0xABCD
.long 0xABCDABCD
.quad 0xABCDABCDABCDABCD
.org 30
.long 0xF000 // 34
.p2align 3, 0xAB // 40 (0xAB * 6)
.short 0 // 42
.p2alignw 3, 0xABCD // 48 (0xABCD * 2)
.short 0 // 50
.p2alignw 3, 0xABCD, 5 // 50
// FIXME: Dump contents, so we can check those too.
// CHECK: File: <stdin>
// CHECK: Format: Mach-O 32-bit i386
// CHECK: Arch: i386
// CHECK: AddressSize: 32bit
// CHECK: MachHeader {
// CHECK: Magic: Magic (0xFEEDFACE)
// CHECK: CpuType: X86 (0x7)
// CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
// CHECK: FileType: Relocatable (0x1)
// CHECK: NumOfLoadCommands: 2
// CHECK: SizeOfLoadCommands: 208
// CHECK: Flags [ (0x0)
// CHECK: ]
// CHECK: }
// CHECK: Sections [
// CHECK: Section {
// CHECK: Index: 0
// CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
// CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
// CHECK: Address: 0x0
// CHECK: Size: 0x0
// CHECK: Offset: 236
// CHECK: Alignment: 0
// CHECK: RelocationOffset: 0x0
// CHECK: RelocationCount: 0
// CHECK: Type: 0x0
// CHECK: Attributes [ (0x800000)
// CHECK: PureInstructions (0x800000)
// CHECK: ]
// CHECK: Reserved1: 0x0
// CHECK: Reserved2: 0x0
// CHECK: }
// CHECK: Section {
// CHECK: Index: 1
// CHECK: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
// CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
// CHECK: Address: 0x0
// CHECK: Size: 0x32
// CHECK: Offset: 236
// CHECK: Alignment: 3
// CHECK: RelocationOffset: 0x0
// CHECK: RelocationCount: 0
// CHECK: Type: 0x0
// CHECK: Attributes [ (0x0)
// CHECK: ]
// CHECK: Reserved1: 0x0
// CHECK: Reserved2: 0x0
// CHECK: }
// CHECK: ]
// CHECK: Segment {
// CHECK: Cmd: LC_SEGMENT
// CHECK: Name:
// CHECK: Size: 192
// CHECK: vmaddr: 0x0
// CHECK: vmsize: 0x32
// CHECK: fileoff: 236
// CHECK: filesize: 50
// CHECK: maxprot: rwx
// CHECK: initprot: rwx
// CHECK: nsects: 2
// CHECK: flags: 0x0
// CHECK: }