1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/test/MC/MachO/data.s
Fangrui Song b2d3b0af04 [llvm-readobj] Change -long-option to --long-option in tests. NFC
We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.

While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).

llvm-svn: 359649
2019-05-01 05:27:20 +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: }