1 ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
2 ; RUN: -xcoff-traceback-table=false < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
4 ; RUN: -xcoff-traceback-table=false < %s | FileCheck %s
5 ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
6 ; RUN: -xcoff-traceback-table=false -filetype=obj -o %t.o < %s
7 ; RUN: llvm-objdump -D --symbol-description %t.o | FileCheck --check-prefix=CHECKOBJ %s
8 ; RUN: llvm-readobj -s %t.o | FileCheck --check-prefix=CHECKSYM %s
10 @ext_const = constant i32 1, section ".ext_const_sec", align 4
11 @ext_var = global i32 1, section ".ext_var_sec", align 4
12 @ext_zvar = global i32 0, section ".ext_zvar_sec", align 4
14 define dso_local signext i32 @ext_fun() section ".ext_fun_sec" {
16 %0 = load i32, ptr @ext_const, align 4
17 %1 = load i32, ptr @ext_var, align 4
18 %add = add nsw i32 %0, %1
19 %2 = load i32, ptr @ext_zvar, align 4
20 %add1 = add nsw i32 %add, %2
24 ; CHECK: .globl ext_fun[DS] # -- Begin function ext_fun
25 ; CHECK-NEXT: .globl .ext_fun
26 ; CHECK-NEXT: .align 4
27 ; CHECK-NEXT: .csect ext_fun[DS]
28 ; CHECK: .csect .ext_fun_sec[PR],5
29 ; CHECK-NEXT: .ext_fun:
30 ; CHECK: .csect .ext_const_sec[RO],2
31 ; CHECK-NEXT: .globl ext_const
32 ; CHECK-NEXT: .align 2
33 ; CHECK-NEXT: ext_const:
34 ; CHECK-NEXT: .vbyte 4, 1 # 0x1
35 ; CHECK-NEXT: .csect .ext_var_sec[RW],2
36 ; CHECK-NEXT: .globl ext_var
37 ; CHECK-NEXT: .align 2
38 ; CHECK-NEXT: ext_var:
39 ; CHECK-NEXT: .vbyte 4, 1 # 0x1
40 ; CHECK-NEXT: .csect .ext_zvar_sec[RW],2
41 ; CHECK-NEXT: .globl ext_zvar
42 ; CHECK-NEXT: .align 2
43 ; CHECK-NEXT: ext_zvar:
44 ; CHECK-NEXT: .vbyte 4, 0 # 0x0
47 ; CHECK-NEXT: .tc ext_var[TC],ext_var
49 ; CHECK-NEXT: .tc ext_zvar[TC],ext_zvar
51 ; CHECKOBJ: 00000000 (idx: [[#INDX:]]) .ext_fun:
52 ; CHECKOBJ-NEXT: 0: 80 62 00 00 lwz 3, 0(2)
53 ; CHECKOBJ-NEXT: 4: 80 82 00 04 lwz 4, 4(2)
54 ; CHECKOBJ-NEXT: 8: 80 63 00 00 lwz 3, 0(3)
55 ; CHECKOBJ-NEXT: c: 80 84 00 00 lwz 4, 0(4)
56 ; CHECKOBJ-NEXT: 10: 7c 63 22 14 add 3, 3, 4
57 ; CHECKOBJ-NEXT: 14: 38 63 00 01 addi 3, 3, 1
58 ; CHECKOBJ-NEXT: 18: 4e 80 00 20 blr
60 ; CHECKOBJ-NEXT: 0000001c (idx: [[#INDX+4]]) ext_const:
61 ; CHECKOBJ-NEXT: 1c: 00 00 00 01 <unknown>
63 ; CHECKOBJ-NEXT: Disassembly of section .data:
65 ; CHECKOBJ-NEXT: 00000020 (idx: [[#INDX+8]]) ext_var:
66 ; CHECKOBJ-NEXT: 20: 00 00 00 01 <unknown>
68 ; CHECKOBJ-NEXT: 00000024 (idx: [[#INDX+12]]) ext_zvar:
69 ; CHECKOBJ-NEXT: 24: 00 00 00 00 <unknown>
71 ; CHECKOBJ-NEXT: 00000028 (idx: [[#INDX+14]]) ext_fun[DS]:
72 ; CHECKOBJ-NEXT: 28: 00 00 00 00 <unknown>
73 ; CHECKOBJ-NEXT: 2c: 00 00 00 34 <unknown>
74 ; CHECKOBJ-NEXT: 30: 00 00 00 00 <unknown>
76 ; CHECKOBJ-NEXT: 00000034 (idx: [[#INDX+18]]) ext_var[TC]:
77 ; CHECKOBJ-NEXT: 34: 00 00 00 20 <unknown>
79 ; CHECKOBJ-NEXT: 00000038 (idx: [[#INDX+20]]) ext_zvar[TC]:
80 ; CHECKOBJ-NEXT: 38: 00 00 00 24 <unknown>
82 ; CHECKSYM: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .ext_fun_sec
83 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
84 ; CHECKSYM-NEXT: Section: .text
85 ; CHECKSYM-NEXT: Type: 0x0
86 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
87 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
88 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
89 ; CHECKSYM-NEXT: Index: [[#INDX+1]]
90 ; CHECKSYM-NEXT: SectionLen: 28
91 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
92 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
93 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 5
94 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
95 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
96 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
97 ; CHECKSYM-NEXT: StabSectNum: 0x0
100 ; CHECKSYM-NEXT: Symbol {
101 ; CHECKSYM-NEXT: Index: [[#INDX+2]]
102 ; CHECKSYM-NEXT: Name: .ext_fun
103 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
104 ; CHECKSYM-NEXT: Section: .text
105 ; CHECKSYM-NEXT: Type: 0x0
106 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
107 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
108 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
109 ; CHECKSYM-NEXT: Index: [[#INDX+3]]
110 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX]]
111 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
112 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
113 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
114 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
115 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
116 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
117 ; CHECKSYM-NEXT: StabSectNum: 0x0
120 ; CHECKSYM-NEXT: Symbol {
121 ; CHECKSYM-NEXT: Index: [[#INDX+4]]
122 ; CHECKSYM-NEXT: Name: .ext_const_sec
123 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x1C
124 ; CHECKSYM-NEXT: Section: .text
125 ; CHECKSYM-NEXT: Type: 0x0
126 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
127 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
128 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
129 ; CHECKSYM-NEXT: Index: [[#INDX+5]]
130 ; CHECKSYM-NEXT: SectionLen: 4
131 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
132 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
133 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
134 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
135 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RO (0x1)
136 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
137 ; CHECKSYM-NEXT: StabSectNum: 0x0
140 ; CHECKSYM-NEXT: Symbol {
141 ; CHECKSYM-NEXT: Index: [[#INDX+6]]
142 ; CHECKSYM-NEXT: Name: ext_const
143 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x1C
144 ; CHECKSYM-NEXT: Section: .text
145 ; CHECKSYM-NEXT: Type: 0x0
146 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
147 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
148 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
149 ; CHECKSYM-NEXT: Index: [[#INDX+7]]
150 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+4]]
151 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
152 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
153 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
154 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
155 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RO (0x1)
156 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
157 ; CHECKSYM-NEXT: StabSectNum: 0x0
160 ; CHECKSYM-NEXT: Symbol {
161 ; CHECKSYM-NEXT: Index: [[#INDX+8]]
162 ; CHECKSYM-NEXT: Name: .ext_var_sec
163 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x20
164 ; CHECKSYM-NEXT: Section: .data
165 ; CHECKSYM-NEXT: Type: 0x0
166 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
167 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
168 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
169 ; CHECKSYM-NEXT: Index: [[#INDX+9]]
170 ; CHECKSYM-NEXT: SectionLen: 4
171 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
172 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
173 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
174 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
175 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
176 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
177 ; CHECKSYM-NEXT: StabSectNum: 0x0
180 ; CHECKSYM-NEXT: Symbol {
181 ; CHECKSYM-NEXT: Index: [[#INDX+10]]
182 ; CHECKSYM-NEXT: Name: ext_var
183 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x20
184 ; CHECKSYM-NEXT: Section: .data
185 ; CHECKSYM-NEXT: Type: 0x0
186 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
187 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
188 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
189 ; CHECKSYM-NEXT: Index: [[#INDX+11]]
190 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]]
191 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
192 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
193 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
194 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
195 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
196 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
197 ; CHECKSYM-NEXT: StabSectNum: 0x0
200 ; CHECKSYM-NEXT: Symbol {
201 ; CHECKSYM-NEXT: Index: [[#INDX+12]]
202 ; CHECKSYM-NEXT: Name: .ext_zvar_sec
203 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x24
204 ; CHECKSYM-NEXT: Section: .data
205 ; CHECKSYM-NEXT: Type: 0x0
206 ; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
207 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
208 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
209 ; CHECKSYM-NEXT: Index: [[#INDX+13]]
210 ; CHECKSYM-NEXT: SectionLen: 4
211 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
212 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
213 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
214 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
215 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
216 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
217 ; CHECKSYM-NEXT: StabSectNum: 0x0
220 ; CHECKSYM-NEXT: Symbol {
221 ; CHECKSYM-NEXT: Index: [[#INDX+14]]
222 ; CHECKSYM-NEXT: Name: ext_zvar
223 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x24
224 ; CHECKSYM-NEXT: Section: .data
225 ; CHECKSYM-NEXT: Type: 0x0
226 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
227 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
228 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
229 ; CHECKSYM-NEXT: Index: [[#INDX+15]]
230 ; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+12]]
231 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
232 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
233 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
234 ; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
235 ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
236 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
237 ; CHECKSYM-NEXT: StabSectNum: 0x0
240 ; CHECKSYM-NEXT: Symbol {
241 ; CHECKSYM-NEXT: Index: [[#INDX+16]]
242 ; CHECKSYM-NEXT: Name: ext_fun
243 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x28
244 ; CHECKSYM-NEXT: Section: .data
245 ; CHECKSYM-NEXT: Type: 0x0
246 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
247 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
248 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
249 ; CHECKSYM-NEXT: Index: [[#INDX+17]]
250 ; CHECKSYM-NEXT: SectionLen: 12
251 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
252 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
253 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
254 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
255 ; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
256 ; CHECKSYM-NEXT: StabInfoIndex: 0x0
257 ; CHECKSYM-NEXT: StabSectNum: 0x0