1 // RUN
: llvm-mc
-triple i386-apple-darwin9
%s
-filetype
=obj
-o
- | llvm-readobj
--file-headers
-S
--sd
-r
--symbols
--macho-segment
--macho-dysymtab
--macho-indirect-symbols | FileCheck
%s
12 movl $
(_text_a
- _text_b
), %eax
13 Ltext_expr_0
= _text_a
- _text_b
14 movl $
(Ltext_expr_0
), %eax
16 movl $
(Ltext_c
- _text_b
), %eax
17 Ltext_expr_1
= Ltext_c
- _text_b
18 movl $
(Ltext_expr_1
), %eax
20 movl $
(Ltext_d
- Ltext_c
), %eax
21 Ltext_expr_2
= Ltext_d
- Ltext_c
22 movl $
(Ltext_expr_2
), %eax
24 movl $
(_text_a
+ Ltext_expr_0
), %eax
36 .long _data_a - _data_b
37 Ldata_expr_0
= _data_a
- _data_b
40 .long Ldata_c - _data_b
41 Ldata_expr_1
= Ldata_c
- _data_b
44 .long Ldata_d - Ldata_c
45 Ldata_expr_2
= Ldata_d
- Ldata_c
48 .long _data_a + Ldata_expr_0
50 // CHECK
: File
: <stdin
>
51 // CHECK
: Format
: Mach-O
32-bit i386
53 // CHECK
: AddressSize
: 32bit
54 // CHECK
: MachHeader
{
55 // CHECK
: Magic
: Magic
(0xFEEDFACE)
56 // CHECK
: CpuType
: X86
(0x7)
57 // CHECK
: CpuSubType
: CPU_SUBTYPE_I386_ALL
(0x3)
58 // CHECK
: FileType
: Relocatable
(0x1)
59 // CHECK
: NumOfLoadCommands
: 4
60 // CHECK
: SizeOfLoadCommands
: 312
61 // CHECK
: Flags
[ (0x0)
67 // CHECK
: Name
: __text
(5F
5F
74 65 78 74 00 00 00 00 00 00 00 00 00 00)
68 // CHECK
: Segment
: __TEXT
(5F
5F
54 45 58 54 00 00 00 00 00 00 00 00 00 00)
69 // CHECK
: Address
: 0x0
72 // CHECK
: Alignment
: 0
73 // CHECK
: RelocationOffset
: 0x1AC
74 // CHECK
: RelocationCount
: 3
75 // CHECK
: Type
: Regular
(0x0)
76 // CHECK
: Attributes
[ (0x800004)
77 // CHECK
: PureInstructions
(0x800000)
78 // CHECK
: SomeInstructions
(0x4)
80 // CHECK
: Reserved1
: 0x0
81 // CHECK
: Reserved2
: 0x0
82 // CHECK
: SectionData
(
83 // CHECK
: 0000: 31C031C0
31C031C0 B8FEFFFF FFB8FEFF |
1.1.1.1.........|
84 // CHECK
: 0010: FFFFB802
000000B8
02000000 B8020000 |
................|
85 // CHECK
: 0020: 00B80200
0000B8FE FFFFFF |
...........|
90 // CHECK
: Name
: __data
(5F
5F
64 61 74 61 00 00 00 00 00 00 00 00 00 00)
91 // CHECK
: Segment
: __DATA
(5F
5F
44 41 54 41 00 00 00 00 00 00 00 00 00 00)
92 // CHECK
: Address
: 0x2B
95 // CHECK
: Alignment
: 0
96 // CHECK
: RelocationOffset
: 0x1C4
97 // CHECK
: RelocationCount
: 3
98 // CHECK
: Type
: Regular
(0x0)
99 // CHECK
: Attributes
[ (0x0)
101 // CHECK
: Reserved1
: 0x0
102 // CHECK
: Reserved2
: 0x0
103 // CHECK
: SectionData
(
104 // CHECK
: 0000: 00000000 00000000 00000000 00000000 |
................|
105 // CHECK
: 0010: FCFFFFFF FCFFFFFF
04000000 04000000 |
................|
106 // CHECK
: 0020: 04000000 04000000 27000000 |
........'...|
110 // CHECK: Relocations [
111 // CHECK: Section __text {
112 // CHECK: 0x27 0 2 n/a GENERIC_RELOC_VANILLA 1 0x0
113 // CHECK: 0x9 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x0
114 // CHECK: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x2
116 // CHECK: Section __data {
117 // CHECK: 0x28 0 2 n/a GENERIC_RELOC_VANILLA 1 0x2B
118 // CHECK: 0x10 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x2B
119 // CHECK: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x2F
124 // CHECK: Name: _text_a (17)
125 // CHECK: Type: Section (0xE)
126 // CHECK: Section: __text (0x1)
127 // CHECK: RefType: UndefinedNonLazy (0x0)
128 // CHECK: Flags [ (0x0)
133 // CHECK: Name: _text_b (1)
134 // CHECK: Type: Section (0xE)
135 // CHECK: Section: __text (0x1)
136 // CHECK: RefType: UndefinedNonLazy (0x0)
137 // CHECK: Flags [ (0x0)
142 // CHECK: Name: _data_a (25)
143 // CHECK: Type: Section (0xE)
144 // CHECK: Section: __data (0x2)
145 // CHECK: RefType: UndefinedNonLazy (0x0)
146 // CHECK: Flags [ (0x0)
148 // CHECK: Value: 0x2B
151 // CHECK: Name: _data_b (9)
152 // CHECK: Type: Section (0xE)
153 // CHECK: Section: __data (0x2)
154 // CHECK: RefType: UndefinedNonLazy (0x0)
155 // CHECK: Flags [ (0x0)
157 // CHECK: Value: 0x2F
160 // CHECK: Indirect Symbols {
166 // CHECK: Cmd: LC_SEGMENT
169 // CHECK: vmaddr: 0x0
170 // CHECK: vmsize: 0x57
171 // CHECK: fileoff: 340
172 // CHECK: filesize: 87
173 // CHECK: maxprot: rwx
174 // CHECK: initprot: rwx
179 // CHECK: ilocalsym: 0
180 // CHECK: nlocalsym: 4
181 // CHECK: iextdefsym: 4
182 // CHECK: nextdefsym: 0
183 // CHECK: iundefsym: 4
184 // CHECK: nundefsym: 0
187 // CHECK: modtaboff: 0
189 // CHECK: extrefsymoff: 0
190 // CHECK: nextrefsyms: 0
191 // CHECK: indirectsymoff: 0
192 // CHECK: nindirectsyms: 0
193 // CHECK: extreloff: 0
195 // CHECK: locreloff: 0