summaryrefslogtreecommitdiff
path: root/test/MC/MachO/data.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/MachO/data.s')
-rw-r--r--test/MC/MachO/data.s67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/MC/MachO/data.s b/test/MC/MachO/data.s
new file mode 100644
index 000000000000..0ff2854801ac
--- /dev/null
+++ b/test/MC/MachO/data.s
@@ -0,0 +1,67 @@
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | 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
+
+// CHECK: ('cputype', 7)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 192)
+// CHECK: ('flag', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 1)
+// CHECK: ('size', 192)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 50)
+// CHECK: ('file_offset', 220)
+// CHECK: ('file_size', 50)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 2)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 0)
+// CHECK: ('offset', 220)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000000)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: # Section 1
+// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 50)
+// CHECK: ('offset', 220)
+// CHECK: ('alignment', 3)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x0)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
+
+// FIXME: Dump contents, so we can check those too.