1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s 2 3_text_a: 4 xorl %eax,%eax 5_text_b: 6 xorl %eax,%eax 7Ltext_c: 8 xorl %eax,%eax 9Ltext_d: 10 xorl %eax,%eax 11 12 movl $(_text_a - _text_b), %eax 13Ltext_expr_0 = _text_a - _text_b 14 movl $(Ltext_expr_0), %eax 15 16 movl $(Ltext_c - _text_b), %eax 17Ltext_expr_1 = Ltext_c - _text_b 18 movl $(Ltext_expr_1), %eax 19 20 movl $(Ltext_d - Ltext_c), %eax 21Ltext_expr_2 = Ltext_d - Ltext_c 22 movl $(Ltext_expr_2), %eax 23 24 movl $(_text_a + Ltext_expr_0), %eax 25 26 .data 27_data_a: 28 .long 0 29_data_b: 30 .long 0 31Ldata_c: 32 .long 0 33Ldata_d: 34 .long 0 35 36 .long _data_a - _data_b 37Ldata_expr_0 = _data_a - _data_b 38 .long Ldata_expr_0 39 40 .long Ldata_c - _data_b 41Ldata_expr_1 = Ldata_c - _data_b 42 .long Ldata_expr_1 43 44 .long Ldata_d - Ldata_c 45Ldata_expr_2 = Ldata_d - Ldata_c 46 .long Ldata_expr_2 47 48 .long _data_a + Ldata_expr_0 49 50// CHECK: ('cputype', 7) 51// CHECK: ('cpusubtype', 3) 52// CHECK: ('filetype', 1) 53// CHECK: ('num_load_commands', 3) 54// CHECK: ('load_commands_size', 296) 55// CHECK: ('flag', 0) 56// CHECK: ('load_commands', [ 57// CHECK: # Load Command 0 58// CHECK: (('command', 1) 59// CHECK: ('size', 192) 60// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 61// CHECK: ('vm_addr', 0) 62// CHECK: ('vm_size', 87) 63// CHECK: ('file_offset', 324) 64// CHECK: ('file_size', 87) 65// CHECK: ('maxprot', 7) 66// CHECK: ('initprot', 7) 67// CHECK: ('num_sections', 2) 68// CHECK: ('flags', 0) 69// CHECK: ('sections', [ 70// CHECK: # Section 0 71// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 72// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 73// CHECK: ('address', 0) 74// CHECK: ('size', 43) 75// CHECK: ('offset', 324) 76// CHECK: ('alignment', 0) 77// CHECK: ('reloc_offset', 412) 78// CHECK: ('num_reloc', 7) 79// CHECK: ('flags', 0x80000400) 80// CHECK: ('reserved1', 0) 81// CHECK: ('reserved2', 0) 82// CHECK: ), 83// CHECK: ('_relocations', [ 84// CHECK: # Relocation 0 85// CHECK: (('word-0', 0xa0000027), 86// CHECK: ('word-1', 0x0)), 87// CHECK: # Relocation 1 88// CHECK: (('word-0', 0xa400001d), 89// CHECK: ('word-1', 0x6)), 90// CHECK: # Relocation 2 91// CHECK: (('word-0', 0xa1000000), 92// CHECK: ('word-1', 0x4)), 93// CHECK: # Relocation 3 94// CHECK: (('word-0', 0xa4000013), 95// CHECK: ('word-1', 0x4)), 96// CHECK: # Relocation 4 97// CHECK: (('word-0', 0xa1000000), 98// CHECK: ('word-1', 0x2)), 99// CHECK: # Relocation 5 100// CHECK: (('word-0', 0xa4000009), 101// CHECK: ('word-1', 0x0)), 102// CHECK: # Relocation 6 103// CHECK: (('word-0', 0xa1000000), 104// CHECK: ('word-1', 0x2)), 105// CHECK: ]) 106// CHECK: ('_section_data', '31c031c0 31c031c0 b8feffff ffb8feff ffffb802 000000b8 02000000 b8020000 00b80200 0000b8fe ffffff') 107// CHECK: # Section 1 108// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 109// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') 110// CHECK: ('address', 43) 111// CHECK: ('size', 44) 112// CHECK: ('offset', 367) 113// CHECK: ('alignment', 0) 114// CHECK: ('reloc_offset', 468) 115// CHECK: ('num_reloc', 7) 116// CHECK: ('flags', 0x0) 117// CHECK: ('reserved1', 0) 118// CHECK: ('reserved2', 0) 119// CHECK: ), 120// CHECK: ('_relocations', [ 121// CHECK: # Relocation 0 122// CHECK: (('word-0', 0xa0000028), 123// CHECK: ('word-1', 0x2b)), 124// CHECK: # Relocation 1 125// CHECK: (('word-0', 0xa4000020), 126// CHECK: ('word-1', 0x37)), 127// CHECK: # Relocation 2 128// CHECK: (('word-0', 0xa1000000), 129// CHECK: ('word-1', 0x33)), 130// CHECK: # Relocation 3 131// CHECK: (('word-0', 0xa4000018), 132// CHECK: ('word-1', 0x33)), 133// CHECK: # Relocation 4 134// CHECK: (('word-0', 0xa1000000), 135// CHECK: ('word-1', 0x2f)), 136// CHECK: # Relocation 5 137// CHECK: (('word-0', 0xa4000010), 138// CHECK: ('word-1', 0x2b)), 139// CHECK: # Relocation 6 140// CHECK: (('word-0', 0xa1000000), 141// CHECK: ('word-1', 0x2f)), 142// CHECK: ]) 143// CHECK: ('_section_data', '00000000 00000000 00000000 00000000 fcffffff fcffffff 04000000 04000000 04000000 04000000 27000000') 144// CHECK: ]) 145// CHECK: ), 146// CHECK: # Load Command 1 147// CHECK: (('command', 2) 148// CHECK: ('size', 24) 149// CHECK: ('symoff', 524) 150// CHECK: ('nsyms', 4) 151// CHECK: ('stroff', 572) 152// CHECK: ('strsize', 36) 153// CHECK: ('_string_data', '\x00_text_a\x00_text_b\x00_data_a\x00_data_b\x00\x00\x00\x00') 154// CHECK: ('_symbols', [ 155// CHECK: # Symbol 0 156// CHECK: (('n_strx', 1) 157// CHECK: ('n_type', 0xe) 158// CHECK: ('n_sect', 1) 159// CHECK: ('n_desc', 0) 160// CHECK: ('n_value', 0) 161// CHECK: ('_string', '_text_a') 162// CHECK: ), 163// CHECK: # Symbol 1 164// CHECK: (('n_strx', 9) 165// CHECK: ('n_type', 0xe) 166// CHECK: ('n_sect', 1) 167// CHECK: ('n_desc', 0) 168// CHECK: ('n_value', 2) 169// CHECK: ('_string', '_text_b') 170// CHECK: ), 171// CHECK: # Symbol 2 172// CHECK: (('n_strx', 17) 173// CHECK: ('n_type', 0xe) 174// CHECK: ('n_sect', 2) 175// CHECK: ('n_desc', 0) 176// CHECK: ('n_value', 43) 177// CHECK: ('_string', '_data_a') 178// CHECK: ), 179// CHECK: # Symbol 3 180// CHECK: (('n_strx', 25) 181// CHECK: ('n_type', 0xe) 182// CHECK: ('n_sect', 2) 183// CHECK: ('n_desc', 0) 184// CHECK: ('n_value', 47) 185// CHECK: ('_string', '_data_b') 186// CHECK: ), 187// CHECK: ]) 188// CHECK: ), 189// CHECK: # Load Command 2 190// CHECK: (('command', 11) 191// CHECK: ('size', 80) 192// CHECK: ('ilocalsym', 0) 193// CHECK: ('nlocalsym', 4) 194// CHECK: ('iextdefsym', 4) 195// CHECK: ('nextdefsym', 0) 196// CHECK: ('iundefsym', 4) 197// CHECK: ('nundefsym', 0) 198// CHECK: ('tocoff', 0) 199// CHECK: ('ntoc', 0) 200// CHECK: ('modtaboff', 0) 201// CHECK: ('nmodtab', 0) 202// CHECK: ('extrefsymoff', 0) 203// CHECK: ('nextrefsyms', 0) 204// CHECK: ('indirectsymoff', 0) 205// CHECK: ('nindirectsyms', 0) 206// CHECK: ('extreloff', 0) 207// CHECK: ('nextrel', 0) 208// CHECK: ('locreloff', 0) 209// CHECK: ('nlocrel', 0) 210// CHECK: ('_indirect_symbols', [ 211// CHECK: ]) 212// CHECK: ), 213// CHECK: ]) 214