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 [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_CPLUSPLUS (0x9)
72 ; CHECKSYM32-NEXT: CPU Version ID: TCPU_COM (0x3)
73 ; CHECKSYM64-NEXT: CPU Version ID: TCPU_PPC64 (0x2)
74 ; CHECKSYM-NEXT: StorageClass: C_FILE (0x67)
75 ; CHECKSYM-NEXT: NumberOfAuxEntries: 0
77 ; CHECKSYM-NEXT: Symbol {
78 ; CHECKSYM-NEXT: Index: [[#Index:]]
79 ; CHECKSYM-NEXT: Name: .foo_ext_weak
80 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
81 ; CHECKSYM-NEXT: Section: N_UNDEF
82 ; CHECKSYM-NEXT: Type: 0x0
83 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
84 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
85 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
86 ; CHECKSYM-NEXT: Index: [[#Index+1]]
87 ; CHECKSYM-NEXT: SectionLen: 0
88 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
89 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
90 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
91 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
92 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
93 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
94 ; CHECKSYM32-NEXT: StabSectNum: 0x0
95 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
98 ; CHECKSYM-NEXT: Symbol {
99 ; CHECKSYM-NEXT: Index: [[#Index+2]]
100 ; CHECKSYM-NEXT: Name: foo_ext_weak_ref
101 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
102 ; CHECKSYM-NEXT: Section: N_UNDEF
103 ; CHECKSYM-NEXT: Type: 0x0
104 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
105 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
106 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
107 ; CHECKSYM-NEXT: Index: [[#Index+3]]
108 ; CHECKSYM-NEXT: SectionLen: 0
109 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
110 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
111 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
112 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
113 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
114 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
115 ; CHECKSYM32-NEXT: StabSectNum: 0x0
116 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
119 ; CHECKSYM-NEXT: Symbol {
120 ; CHECKSYM-NEXT: Index: [[#Index+4]]
121 ; CHECKSYM-NEXT: Name: b_w
122 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
123 ; CHECKSYM-NEXT: Section: N_UNDEF
124 ; CHECKSYM-NEXT: Type: 0x0
125 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
126 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
127 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
128 ; CHECKSYM-NEXT: Index: [[#Index+5]]
129 ; CHECKSYM-NEXT: SectionLen: 0
130 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
131 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
132 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
133 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
134 ; CHECKSYM-NEXT: StorageMappingClass: XMC_UA (0x4)
135 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
136 ; CHECKSYM32-NEXT: StabSectNum: 0x0
137 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
140 ; CHECKSYM-NEXT: Symbol {
141 ; CHECKSYM-NEXT: Index: [[#Index+6]]
142 ; CHECKSYM-NEXT: Name: .foo_ext_weak_ref
143 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
144 ; CHECKSYM-NEXT: Section: N_UNDEF
145 ; CHECKSYM-NEXT: Type: 0x0
146 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
147 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
148 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
149 ; CHECKSYM-NEXT: Index: [[#Index+7]]
150 ; CHECKSYM-NEXT: SectionLen: 0
151 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
152 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
153 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
154 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
155 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
156 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
157 ; CHECKSYM32-NEXT: StabSectNum: 0x0
158 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
161 ; CHECKSYM-NEXT: Symbol {
162 ; CHECKSYM-NEXT: Index: [[#Index+8]]
163 ; CHECKSYM-NEXT: Name: foo_ext_weak
164 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
165 ; CHECKSYM-NEXT: Section: N_UNDEF
166 ; CHECKSYM-NEXT: Type: 0x0
167 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
168 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
169 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
170 ; CHECKSYM-NEXT: Index: [[#Index+9]]
171 ; CHECKSYM-NEXT: SectionLen: 0
172 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
173 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
174 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
175 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
176 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
177 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
178 ; CHECKSYM32-NEXT: StabSectNum: 0x0
179 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
182 ; CHECKSYM-NEXT: Symbol {
183 ; CHECKSYM-NEXT: Index: [[#Index+10]]
184 ; CHECKSYM-NEXT: Name:
185 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
186 ; CHECKSYM-NEXT: Section: .text
187 ; CHECKSYM-NEXT: Type: 0x0
188 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
189 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
190 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
191 ; CHECKSYM-NEXT: Index: [[#Index+11]]
192 ; CHECKSYM-NEXT: SectionLen: 80
193 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
194 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
195 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 5
196 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
197 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
198 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
199 ; CHECKSYM32-NEXT: StabSectNum: 0x0
200 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
203 ; CHECKSYM-NEXT: Symbol {
204 ; CHECKSYM-NEXT: Index: [[#Index+12]]
205 ; CHECKSYM-NEXT: Name: .main
206 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
207 ; CHECKSYM-NEXT: Section: .text
208 ; CHECKSYM-NEXT: Type: 0x0
209 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
210 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
211 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
212 ; CHECKSYM-NEXT: Index: [[#Index+13]]
213 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+10]]
214 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
215 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
216 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
217 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
218 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
219 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
220 ; CHECKSYM32-NEXT: StabSectNum: 0x0
221 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
224 ; CHECKSYM-NEXT: Symbol {
225 ; CHECKSYM-NEXT: Index: [[#Index+14]]
226 ; CHECKSYM-NEXT: Name: .data
227 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50
228 ; CHECKSYM-NEXT: Section: .data
229 ; CHECKSYM-NEXT: Type: 0x0
230 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
231 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
232 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
233 ; CHECKSYM-NEXT: Index: [[#Index+15]]
234 ; CHECKSYM32-NEXT: SectionLen: 4
235 ; CHECKSYM64-NEXT: SectionLen: 8
236 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
237 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
238 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
239 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
240 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
241 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
242 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
243 ; CHECKSYM32-NEXT: StabSectNum: 0x0
244 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
247 ; CHECKSYM-NEXT: Symbol {
248 ; CHECKSYM-NEXT: Index: [[#Index+16]]
249 ; CHECKSYM-NEXT: Name: foo_ext_weak_p
250 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50
251 ; CHECKSYM-NEXT: Section: .data
252 ; CHECKSYM-NEXT: Type: 0x0
253 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
254 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
255 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
256 ; CHECKSYM-NEXT: Index: [[#Index+17]]
257 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+14]]
258 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
259 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
260 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
261 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
262 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
263 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
264 ; CHECKSYM32-NEXT: StabSectNum: 0x0
265 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
268 ; CHECKSYM-NEXT: Symbol {
269 ; CHECKSYM-NEXT: Index: [[#Index+18]]
270 ; CHECKSYM-NEXT: Name: main
271 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x54
272 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x58
273 ; CHECKSYM-NEXT: Section: .data
274 ; CHECKSYM-NEXT: Type: 0x0
275 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
276 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
277 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
278 ; CHECKSYM-NEXT: Index: [[#Index+19]]
279 ; CHECKSYM32-NEXT: SectionLen: 12
280 ; CHECKSYM64-NEXT: SectionLen: 24
281 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
282 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
283 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
284 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
285 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
286 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
287 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
288 ; CHECKSYM32-NEXT: StabSectNum: 0x0
289 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
292 ; CHECKSYM-NEXT: Symbol {
293 ; CHECKSYM-NEXT: Index: [[#Index+20]]
294 ; CHECKSYM-NEXT: Name: TOC
295 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x60
296 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70
297 ; CHECKSYM-NEXT: Section: .data
298 ; CHECKSYM-NEXT: Type: 0x0
299 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
300 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
301 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
302 ; CHECKSYM-NEXT: Index: [[#Index+21]]
303 ; CHECKSYM-NEXT: SectionLen: 0
304 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
305 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
306 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
307 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
308 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
309 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
310 ; CHECKSYM32-NEXT: StabSectNum: 0x0
311 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
314 ; CHECKSYM-NEXT: Symbol {
315 ; CHECKSYM-NEXT: Index: [[#Index+22]]
316 ; CHECKSYM-NEXT: Name: foo_ext_weak_p
317 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x60
318 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70
319 ; CHECKSYM-NEXT: Section: .data
320 ; CHECKSYM-NEXT: Type: 0x0
321 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
322 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
323 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
324 ; CHECKSYM-NEXT: Index: [[#Index+23]]
325 ; CHECKSYM32-NEXT: SectionLen: 4
326 ; CHECKSYM64-NEXT: SectionLen: 8
327 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
328 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
329 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
330 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
331 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
332 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
333 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
334 ; CHECKSYM32-NEXT: StabSectNum: 0x0
335 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
338 ; CHECKSYM-NEXT: Symbol {
339 ; CHECKSYM-NEXT: Index: [[#Index+24]]
340 ; CHECKSYM-NEXT: Name: b_w
341 ; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x64
342 ; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x78
343 ; CHECKSYM-NEXT: Section: .data
344 ; CHECKSYM-NEXT: Type: 0x0
345 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
346 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
347 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
348 ; CHECKSYM-NEXT: Index: [[#Index+25]]
349 ; CHECKSYM32-NEXT: SectionLen: 4
350 ; CHECKSYM64-NEXT: SectionLen: 8
351 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
352 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
353 ; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
354 ; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
355 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
356 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
357 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
358 ; CHECKSYM32-NEXT: StabSectNum: 0x0
359 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)