blob: 0ff2854801ac1a8e1c1f539eb8642ee6732cea6e [file] [log] [blame]
Daniel Dunbar2080ffc2009-08-22 09:45:43 +00001// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s
Daniel Dunbar8fcefbe2009-08-21 18:29:01 +00002
3 .data
4 .ascii "hello"
5 .byte 0xAB
6 .short 0xABCD
7 .long 0xABCDABCD
8 .quad 0xABCDABCDABCDABCD
Daniel Dunbar3d153ff2009-08-21 23:07:38 +00009.org 30
10 .long 0xF000 // 34
11 .p2align 3, 0xAB // 40 (0xAB * 6)
12 .short 0 // 42
13 .p2alignw 3, 0xABCD // 48 (0xABCD * 2)
14 .short 0 // 50
15 .p2alignw 3, 0xABCD, 5 // 50
Daniel Dunbar8fcefbe2009-08-21 18:29:01 +000016
17// CHECK: ('cputype', 7)
18// CHECK: ('cpusubtype', 3)
19// CHECK: ('filetype', 1)
20// CHECK: ('num_load_commands', 1)
21// CHECK: ('load_commands_size', 192)
22// CHECK: ('flag', 0)
23// CHECK: ('load_commands', [
24// CHECK: # Load Command 0
25// CHECK: (('command', 1)
26// CHECK: ('size', 192)
27// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
28// CHECK: ('vm_addr', 0)
Daniel Dunbar3d153ff2009-08-21 23:07:38 +000029// CHECK: ('vm_size', 50)
Daniel Dunbar8fcefbe2009-08-21 18:29:01 +000030// CHECK: ('file_offset', 220)
Daniel Dunbar3d153ff2009-08-21 23:07:38 +000031// CHECK: ('file_size', 50)
Daniel Dunbar8fcefbe2009-08-21 18:29:01 +000032// CHECK: ('maxprot', 7)
33// CHECK: ('initprot', 7)
34// CHECK: ('num_sections', 2)
35// CHECK: ('flags', 0)
36// CHECK: ('sections', [
37// CHECK: # Section 0
38// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
39// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
40// CHECK: ('address', 0)
41// CHECK: ('size', 0)
42// CHECK: ('offset', 220)
43// CHECK: ('alignment', 0)
44// CHECK: ('reloc_offset', 0)
45// CHECK: ('num_reloc', 0)
46// CHECK: ('flags', 0x80000000)
47// CHECK: ('reserved1', 0)
48// CHECK: ('reserved2', 0)
49// CHECK: ),
50// CHECK: # Section 1
51// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
52// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
53// CHECK: ('address', 0)
Daniel Dunbar3d153ff2009-08-21 23:07:38 +000054// CHECK: ('size', 50)
Daniel Dunbar8fcefbe2009-08-21 18:29:01 +000055// CHECK: ('offset', 220)
Daniel Dunbar3d153ff2009-08-21 23:07:38 +000056// CHECK: ('alignment', 3)
Daniel Dunbar8fcefbe2009-08-21 18:29:01 +000057// CHECK: ('reloc_offset', 0)
58// CHECK: ('num_reloc', 0)
59// CHECK: ('flags', 0x0)
60// CHECK: ('reserved1', 0)
61// CHECK: ('reserved2', 0)
62// CHECK: ),
63// CHECK: ])
64// CHECK: ),
65// CHECK: ])
66
67// FIXME: Dump contents, so we can check those too.