1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
2 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | FileCheck --check-prefixes=COMMON,BIT32 %s
4 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
5 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | FileCheck --check-prefixes=COMMON,BIT64 %s
7 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
8 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s
9 ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s
11 ; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \
12 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o 2>&1 < %s | \
13 ; RUN: FileCheck --check-prefix=XCOFF64 %s
14 ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet.
17 @foo_ext_weak_p = global void (...)* bitcast (void ()* @foo_ext_weak_ref to void (...)*)
18 @b_w = extern_weak global i32
20 declare extern_weak void @foo_ext_weak_ref()
24 %0 = load void (...)*, void (...)** @foo_ext_weak_p
25 %callee.knr.cast = bitcast void (...)* %0 to void ()*
26 call void %callee.knr.cast()
27 call void @foo_ext_weak(i32* @b_w)
31 declare extern_weak void @foo_ext_weak(i32*)
33 ; COMMON: .globl main[DS] # -- Begin function main
34 ; COMMON-NEXT: .globl .main
35 ; COMMON-NEXT: .align 4
36 ; COMMON-NEXT: .csect main[DS]
37 ; BIT32-NEXT: .vbyte 4, .main # @main
38 ; BIT32-NEXT: .vbyte 4, TOC[TC0]
39 ; BIT32-NEXT: .vbyte 4, 0
40 ; BIT64-NEXT: .vbyte 8, .main # @main
41 ; BIT64-NEXT: .vbyte 8, TOC[TC0]
42 ; BIT64-NEXT: .vbyte 8, 0
43 ; COMMON-NEXT: .csect .text[PR]
46 ; COMMON: .csect .data[RW]
47 ; COMMON: .globl foo_ext_weak_p
48 ; BIT32-NEXT: .align 2
49 ; BIT64-NEXT: .align 3
50 ; COMMON-NEXT: foo_ext_weak_p:
51 ; BIT32-NEXT: .vbyte 4, foo_ext_weak_ref[DS]
52 ; BIT64-NEXT: .vbyte 8, foo_ext_weak_ref[DS]
53 ; COMMON-NEXT: .weak b_w[UA]
54 ; COMMON-NEXT: .weak .foo_ext_weak_ref[PR]
55 ; COMMON-NEXT: .weak foo_ext_weak_ref[DS]
56 ; COMMON-NEXT: .weak .foo_ext_weak[PR]
57 ; COMMON-NEXT: .weak foo_ext_weak[DS]
60 ; COMMON-NEXT: .tc foo_ext_weak_p[TC],foo_ext_weak_p
62 ; COMMON-NEXT: .tc b_w[TC],b_w[UA]
65 ; CHECKSYM-NEXT: Symbol {
66 ; CHECKSYM-NEXT: Index: 0
67 ; CHECKSYM-NEXT: Name: .file
68 ; CHECKSYM-NEXT: Value (SymbolTableIndex): 0x0
69 ; CHECKSYM-NEXT: Section: N_DEBUG
70 ; CHECKSYM-NEXT: Source Language ID: TB_C (0x0)
71 ; CHECKSYM-NEXT: CPU Version ID: 0x0
72 ; CHECKSYM-NEXT: StorageClass: C_FILE (0x67)
73 ; CHECKSYM-NEXT: NumberOfAuxEntries: 0
75 ; CHECKSYM-NEXT: Symbol {
76 ; CHECKSYM-NEXT: Index: [[#Index:]]
77 ; CHECKSYM-NEXT: Name: .foo_ext_weak
78 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
79 ; CHECKSYM-NEXT: Section: N_UNDEF
80 ; CHECKSYM-NEXT: Type: 0x0
81 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
82 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
83 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
84 ; CHECKSYM-NEXT: Index: [[#Index+1]]
85 ; CHECKSYM-NEXT: SectionLen: 0
86 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
87 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
88 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
89 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
90 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
91 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
92 ; CHECKSYM-NEXT: StabSectNum: 0x0
95 ; CHECKSYM-NEXT: Symbol {
96 ; CHECKSYM-NEXT: Index: [[#Index+2]]
97 ; CHECKSYM-NEXT: Name: foo_ext_weak_ref
98 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
99 ; CHECKSYM-NEXT: Section: N_UNDEF
100 ; CHECKSYM-NEXT: Type: 0x0
101 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
102 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
103 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
104 ; CHECKSYM-NEXT: Index: [[#Index+3]]
105 ; CHECKSYM-NEXT: SectionLen: 0
106 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
107 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
108 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
109 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
110 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
111 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
112 ; CHECKSYM-NEXT: StabSectNum: 0x0
115 ; CHECKSYM-NEXT: Symbol {
116 ; CHECKSYM-NEXT: Index: [[#Index+4]]
117 ; CHECKSYM-NEXT: Name: b_w
118 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
119 ; CHECKSYM-NEXT: Section: N_UNDEF
120 ; CHECKSYM-NEXT: Type: 0x0
121 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
122 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
123 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
124 ; CHECKSYM-NEXT: Index: [[#Index+5]]
125 ; CHECKSYM-NEXT: SectionLen: 0
126 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
127 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
128 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
129 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
130 ; CHECKSYM-NEXT: StorageMappingClass: XMC_UA (0x4)
131 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
132 ; CHECKSYM-NEXT: StabSectNum: 0x0
135 ; CHECKSYM-NEXT: Symbol {
136 ; CHECKSYM-NEXT: Index: [[#Index+6]]
137 ; CHECKSYM-NEXT: Name: .foo_ext_weak_ref
138 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
139 ; CHECKSYM-NEXT: Section: N_UNDEF
140 ; CHECKSYM-NEXT: Type: 0x0
141 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
142 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
143 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
144 ; CHECKSYM-NEXT: Index: [[#Index+7]]
145 ; CHECKSYM-NEXT: SectionLen: 0
146 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
147 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
148 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
149 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
150 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
151 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
152 ; CHECKSYM-NEXT: StabSectNum: 0x0
155 ; CHECKSYM-NEXT: Symbol {
156 ; CHECKSYM-NEXT: Index: [[#Index+8]]
157 ; CHECKSYM-NEXT: Name: foo_ext_weak
158 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
159 ; CHECKSYM-NEXT: Section: N_UNDEF
160 ; CHECKSYM-NEXT: Type: 0x0
161 ; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
162 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
163 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
164 ; CHECKSYM-NEXT: Index: [[#Index+9]]
165 ; CHECKSYM-NEXT: SectionLen: 0
166 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
167 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
168 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
169 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
170 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
171 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
172 ; CHECKSYM-NEXT: StabSectNum: 0x0
175 ; CHECKSYM-NEXT: Symbol {
176 ; CHECKSYM-NEXT: Index: [[#Index+10]]
177 ; CHECKSYM-NEXT: Name: .text
178 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
179 ; CHECKSYM-NEXT: Section: .text
180 ; CHECKSYM-NEXT: Type: 0x0
181 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
182 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
183 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
184 ; CHECKSYM-NEXT: Index: [[#Index+11]]
185 ; CHECKSYM-NEXT: SectionLen: 80
186 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
187 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
188 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 4
189 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
190 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
191 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
192 ; CHECKSYM-NEXT: StabSectNum: 0x0
195 ; CHECKSYM-NEXT: Symbol {
196 ; CHECKSYM-NEXT: Index: [[#Index+12]]
197 ; CHECKSYM-NEXT: Name: .main
198 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
199 ; CHECKSYM-NEXT: Section: .text
200 ; CHECKSYM-NEXT: Type: 0x0
201 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
202 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
203 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
204 ; CHECKSYM-NEXT: Index: [[#Index+13]]
205 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+10]]
206 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
207 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
208 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
209 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
210 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
211 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
212 ; CHECKSYM-NEXT: StabSectNum: 0x0
215 ; CHECKSYM-NEXT: Symbol {
216 ; CHECKSYM-NEXT: Index: [[#Index+14]]
217 ; CHECKSYM-NEXT: Name: .data
218 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50
219 ; CHECKSYM-NEXT: Section: .data
220 ; CHECKSYM-NEXT: Type: 0x0
221 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
222 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
223 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
224 ; CHECKSYM-NEXT: Index: [[#Index+15]]
225 ; CHECKSYM-NEXT: SectionLen: 4
226 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
227 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
228 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
229 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
230 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
231 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
232 ; CHECKSYM-NEXT: StabSectNum: 0x0
235 ; CHECKSYM-NEXT: Symbol {
236 ; CHECKSYM-NEXT: Index: [[#Index+16]]
237 ; CHECKSYM-NEXT: Name: foo_ext_weak_p
238 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50
239 ; CHECKSYM-NEXT: Section: .data
240 ; CHECKSYM-NEXT: Type: 0x0
241 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
242 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
243 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
244 ; CHECKSYM-NEXT: Index: [[#Index+17]]
245 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+14]]
246 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
247 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
248 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
249 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
250 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
251 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
252 ; CHECKSYM-NEXT: StabSectNum: 0x0
255 ; CHECKSYM-NEXT: Symbol {
256 ; CHECKSYM-NEXT: Index: [[#Index+18]]
257 ; CHECKSYM-NEXT: Name: main
258 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x54
259 ; CHECKSYM-NEXT: Section: .data
260 ; CHECKSYM-NEXT: Type: 0x0
261 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
262 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
263 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
264 ; CHECKSYM-NEXT: Index: [[#Index+19]]
265 ; CHECKSYM-NEXT: SectionLen: 12
266 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
267 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
268 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
269 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
270 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
271 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
272 ; CHECKSYM-NEXT: StabSectNum: 0x0
275 ; CHECKSYM-NEXT: Symbol {
276 ; CHECKSYM-NEXT: Index: [[#Index+20]]
277 ; CHECKSYM-NEXT: Name: TOC
278 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x60
279 ; CHECKSYM-NEXT: Section: .data
280 ; CHECKSYM-NEXT: Type: 0x0
281 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
282 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
283 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
284 ; CHECKSYM-NEXT: Index: [[#Index+21]]
285 ; CHECKSYM-NEXT: SectionLen: 0
286 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
287 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
288 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
289 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
290 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
291 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
292 ; CHECKSYM-NEXT: StabSectNum: 0x0
295 ; CHECKSYM-NEXT: Symbol {
296 ; CHECKSYM-NEXT: Index: [[#Index+22]]
297 ; CHECKSYM-NEXT: Name: foo_ext_weak_p
298 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x60
299 ; CHECKSYM-NEXT: Section: .data
300 ; CHECKSYM-NEXT: Type: 0x0
301 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
302 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
303 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
304 ; CHECKSYM-NEXT: Index: [[#Index+23]]
305 ; CHECKSYM-NEXT: SectionLen: 4
306 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
307 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
308 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
309 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
310 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
311 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
312 ; CHECKSYM-NEXT: StabSectNum: 0x0
315 ; CHECKSYM-NEXT: Symbol {
316 ; CHECKSYM-NEXT: Index: [[#Index+24]]
317 ; CHECKSYM-NEXT: Name: b_w
318 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x64
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+25]]
325 ; CHECKSYM-NEXT: SectionLen: 4
326 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
327 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
328 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
329 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
330 ; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
331 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
332 ; CHECKSYM-NEXT: StabSectNum: 0x0