1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
2 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
3 ; RUN: FileCheck --check-prefixes=COMMON,BIT32 %s
5 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
6 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
7 ; RUN: FileCheck --check-prefixes=COMMON,BIT64 %s
9 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
10 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false \
11 ; RUN: -filetype=obj -o %t.o < %s
12 ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM32 %s
14 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
15 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false \
16 ; RUN: -filetype=obj -o %t64.o < %s
17 ; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM64 %s
19 @foo_ext_weak_p = global ptr @foo_ext_weak_ref
20 @b_w = extern_weak global i32
22 declare extern_weak void @foo_ext_weak_ref()
26 %0 = load ptr, ptr @foo_ext_weak_p
28 call void @foo_ext_weak(ptr @b_w)
32 declare extern_weak void @foo_ext_weak(ptr)
34 ; COMMON: .globl main[DS] # -- Begin function main
35 ; COMMON-NEXT: .globl .main
36 ; COMMON-NEXT: .align 4
37 ; COMMON-NEXT: .csect main[DS]
38 ; BIT32-NEXT: .vbyte 4, .main # @main
39 ; BIT32-NEXT: .vbyte 4, TOC[TC0]
40 ; BIT32-NEXT: .vbyte 4, 0
41 ; BIT64-NEXT: .vbyte 8, .main # @main
42 ; BIT64-NEXT: .vbyte 8, TOC[TC0]
43 ; BIT64-NEXT: .vbyte 8, 0
44 ; COMMON-NEXT: .csect .text[PR]
47 ; COMMON: .csect .data[RW]
48 ; COMMON: .globl foo_ext_weak_p
49 ; BIT32-NEXT: .align 2
50 ; BIT64-NEXT: .align 3
51 ; COMMON-NEXT: foo_ext_weak_p:
52 ; BIT32-NEXT: .vbyte 4, foo_ext_weak_ref[DS]
53 ; BIT64-NEXT: .vbyte 8, foo_ext_weak_ref[DS]
54 ; COMMON-NEXT: .weak b_w[UA]
55 ; COMMON-NEXT: .weak .foo_ext_weak_ref[PR]
56 ; COMMON-NEXT: .weak foo_ext_weak_ref[DS]
57 ; COMMON-NEXT: .weak .foo_ext_weak[PR]
58 ; COMMON-NEXT: .weak foo_ext_weak[DS]
61 ; COMMON-NEXT: .tc foo_ext_weak_p[TC],foo_ext_weak_p
63 ; COMMON-NEXT: .tc b_w[TC],b_w[UA]
66 ; CHECKSYM-NEXT: Symbol {
67 ; CHECKSYM-NEXT: Index: 0
68 ; CHECKSYM-NEXT: Name: <stdin>
69 ; CHECKSYM-NEXT: Value (SymbolTableIndex): 0x0
70 ; CHECKSYM-NEXT: Section: N_DEBUG
71 ; CHECKSYM-NEXT: Source Language ID: TB_C (0x0)
72 ; CHECKSYM-NEXT: CPU Version ID: 0x0
73 ; CHECKSYM-NEXT: StorageClass: C_FILE (0x67)
74 ; CHECKSYM-NEXT: NumberOfAuxEntries: 0
76 ; CHECKSYM-NEXT: Symbol {
77 ; CHECKSYM-NEXT: Index: [[#Index:]]
78 ; CHECKSYM-NEXT: Name: .foo_ext_weak
79 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
80 ; CHECKSYM-NEXT: Section: N_UNDEF
81 ; CHECKSYM-NEXT: Type: 0x0
82 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
83 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
84 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
85 ; CHECKSYM-NEXT: Index: [[#Index+1]]
86 ; CHECKSYM-NEXT: SectionLen: 0
87 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
88 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
89 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
90 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
91 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
92 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
93 ; CHECKSYM32-NEXT: StabSectNum: 0x0
94 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
97 ; CHECKSYM-NEXT: Symbol {
98 ; CHECKSYM-NEXT: Index: [[#Index+2]]
99 ; CHECKSYM-NEXT: Name: foo_ext_weak_ref
100 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
101 ; CHECKSYM-NEXT: Section: N_UNDEF
102 ; CHECKSYM-NEXT: Type: 0x0
103 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
104 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
105 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
106 ; CHECKSYM-NEXT: Index: [[#Index+3]]
107 ; CHECKSYM-NEXT: SectionLen: 0
108 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
109 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
110 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
111 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
112 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
113 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
114 ; CHECKSYM32-NEXT: StabSectNum: 0x0
115 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
118 ; CHECKSYM-NEXT: Symbol {
119 ; CHECKSYM-NEXT: Index: [[#Index+4]]
120 ; CHECKSYM-NEXT: Name: b_w
121 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
122 ; CHECKSYM-NEXT: Section: N_UNDEF
123 ; CHECKSYM-NEXT: Type: 0x0
124 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
125 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
126 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
127 ; CHECKSYM-NEXT: Index: [[#Index+5]]
128 ; CHECKSYM-NEXT: SectionLen: 0
129 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
130 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
131 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
132 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
133 ; CHECKSYM-NEXT: StorageMappingClass: XMC_UA (0x4)
134 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
135 ; CHECKSYM32-NEXT: StabSectNum: 0x0
136 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
139 ; CHECKSYM-NEXT: Symbol {
140 ; CHECKSYM-NEXT: Index: [[#Index+6]]
141 ; CHECKSYM-NEXT: Name: .foo_ext_weak_ref
142 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
143 ; CHECKSYM-NEXT: Section: N_UNDEF
144 ; CHECKSYM-NEXT: Type: 0x0
145 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
146 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
147 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
148 ; CHECKSYM-NEXT: Index: [[#Index+7]]
149 ; CHECKSYM-NEXT: SectionLen: 0
150 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
151 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
152 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
153 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
154 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
155 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
156 ; CHECKSYM32-NEXT: StabSectNum: 0x0
157 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
160 ; CHECKSYM-NEXT: Symbol {
161 ; CHECKSYM-NEXT: Index: [[#Index+8]]
162 ; CHECKSYM-NEXT: Name: foo_ext_weak
163 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
164 ; CHECKSYM-NEXT: Section: N_UNDEF
165 ; CHECKSYM-NEXT: Type: 0x0
166 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
167 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
168 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
169 ; CHECKSYM-NEXT: Index: [[#Index+9]]
170 ; CHECKSYM-NEXT: SectionLen: 0
171 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
172 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
173 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
174 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
175 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
176 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
177 ; CHECKSYM32-NEXT: StabSectNum: 0x0
178 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
181 ; CHECKSYM-NEXT: Symbol {
182 ; CHECKSYM-NEXT: Index: [[#Index+10]]
183 ; CHECKSYM-NEXT: Name: .text
184 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
185 ; CHECKSYM-NEXT: Section: .text
186 ; CHECKSYM-NEXT: Type: 0x0
187 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
188 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
189 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
190 ; CHECKSYM-NEXT: Index: [[#Index+11]]
191 ; CHECKSYM-NEXT: SectionLen: 80
192 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
193 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
194 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 5
195 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
196 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
197 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
198 ; CHECKSYM32-NEXT: StabSectNum: 0x0
199 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
202 ; CHECKSYM-NEXT: Symbol {
203 ; CHECKSYM-NEXT: Index: [[#Index+12]]
204 ; CHECKSYM-NEXT: Name: .main
205 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
206 ; CHECKSYM-NEXT: Section: .text
207 ; CHECKSYM-NEXT: Type: 0x0
208 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
209 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
210 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
211 ; CHECKSYM-NEXT: Index: [[#Index+13]]
212 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+10]]
213 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
214 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
215 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
216 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
217 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
218 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
219 ; CHECKSYM32-NEXT: StabSectNum: 0x0
220 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
223 ; CHECKSYM-NEXT: Symbol {
224 ; CHECKSYM-NEXT: Index: [[#Index+14]]
225 ; CHECKSYM-NEXT: Name: .data
226 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50
227 ; CHECKSYM-NEXT: Section: .data
228 ; CHECKSYM-NEXT: Type: 0x0
229 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
230 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
231 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
232 ; CHECKSYM-NEXT: Index: [[#Index+15]]
233 ; CHECKSYM32-NEXT: SectionLen: 4
234 ; CHECKSYM64-NEXT: SectionLen: 8
235 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
236 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
237 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
238 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
239 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
240 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
241 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
242 ; CHECKSYM32-NEXT: StabSectNum: 0x0
243 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
246 ; CHECKSYM-NEXT: Symbol {
247 ; CHECKSYM-NEXT: Index: [[#Index+16]]
248 ; CHECKSYM-NEXT: Name: foo_ext_weak_p
249 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50
250 ; CHECKSYM-NEXT: Section: .data
251 ; CHECKSYM-NEXT: Type: 0x0
252 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
253 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
254 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
255 ; CHECKSYM-NEXT: Index: [[#Index+17]]
256 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+14]]
257 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
258 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
259 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
260 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
261 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
262 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
263 ; CHECKSYM32-NEXT: StabSectNum: 0x0
264 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
267 ; CHECKSYM-NEXT: Symbol {
268 ; CHECKSYM-NEXT: Index: [[#Index+18]]
269 ; CHECKSYM-NEXT: Name: main
270 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x54
271 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x58
272 ; CHECKSYM-NEXT: Section: .data
273 ; CHECKSYM-NEXT: Type: 0x0
274 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
275 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
276 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
277 ; CHECKSYM-NEXT: Index: [[#Index+19]]
278 ; CHECKSYM32-NEXT: SectionLen: 12
279 ; CHECKSYM64-NEXT: SectionLen: 24
280 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
281 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
282 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
283 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
284 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
285 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
286 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
287 ; CHECKSYM32-NEXT: StabSectNum: 0x0
288 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
291 ; CHECKSYM-NEXT: Symbol {
292 ; CHECKSYM-NEXT: Index: [[#Index+20]]
293 ; CHECKSYM-NEXT: Name: TOC
294 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x60
295 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70
296 ; CHECKSYM-NEXT: Section: .data
297 ; CHECKSYM-NEXT: Type: 0x0
298 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
299 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
300 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
301 ; CHECKSYM-NEXT: Index: [[#Index+21]]
302 ; CHECKSYM-NEXT: SectionLen: 0
303 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
304 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
305 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
306 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
307 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
308 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
309 ; CHECKSYM32-NEXT: StabSectNum: 0x0
310 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
313 ; CHECKSYM-NEXT: Symbol {
314 ; CHECKSYM-NEXT: Index: [[#Index+22]]
315 ; CHECKSYM-NEXT: Name: foo_ext_weak_p
316 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x60
317 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70
318 ; CHECKSYM-NEXT: Section: .data
319 ; CHECKSYM-NEXT: Type: 0x0
320 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
321 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
322 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
323 ; CHECKSYM-NEXT: Index: [[#Index+23]]
324 ; CHECKSYM32-NEXT: SectionLen: 4
325 ; CHECKSYM64-NEXT: SectionLen: 8
326 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
327 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
328 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
329 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
330 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
331 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
332 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
333 ; CHECKSYM32-NEXT: StabSectNum: 0x0
334 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
337 ; CHECKSYM-NEXT: Symbol {
338 ; CHECKSYM-NEXT: Index: [[#Index+24]]
339 ; CHECKSYM-NEXT: Name: b_w
340 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x64
341 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x78
342 ; CHECKSYM-NEXT: Section: .data
343 ; CHECKSYM-NEXT: Type: 0x0
344 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
345 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
346 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
347 ; CHECKSYM-NEXT: Index: [[#Index+25]]
348 ; CHECKSYM32-NEXT: SectionLen: 4
349 ; CHECKSYM64-NEXT: SectionLen: 8
350 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
351 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
352 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
353 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
354 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
355 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
356 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
357 ; CHECKSYM32-NEXT: StabSectNum: 0x0
358 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)