1 ; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s
3 ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
4 ; RUN: llvm-readobj --section-headers --file-header %t.o | \
5 ; RUN: FileCheck --check-prefix=OBJ %s
6 ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s
8 ; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t.o 2>&1 \
9 ; RUN: < %s | FileCheck --check-prefix=XCOFF64 %s
11 ; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet.
13 @a = common global i32 0, align 4
14 @b = common global i64 0, align 8
15 @c = common global i16 0, align 2
17 @d = common local_unnamed_addr global double 0.000000e+00, align 8
18 @f = common local_unnamed_addr global float 0.000000e+00, align 4
20 @over_aligned = common local_unnamed_addr global double 0.000000e+00, align 32
22 @array = common local_unnamed_addr global [33 x i8] zeroinitializer, align 1
26 ; CHECK: .csect .text[PR]
28 ; CHECK-NEXT: .comm a,4,2
29 ; CHECK-NEXT: .comm b,8,3
30 ; CHECK-NEXT: .comm c,2,1
31 ; CHECK-NEXT: .comm d,8,3
32 ; CHECK-NEXT: .comm f,4,2
33 ; CHECK-NEXT: .comm over_aligned,8,5
34 ; CHECK-NEXT: .comm array,33,0
36 ; OBJ: File: {{.*}}aix-xcoff-common.ll.tmp.o
37 ; OBJ-NEXT: Format: aixcoff-rs6000
38 ; OBJ-NEXT: Arch: powerpc
39 ; OBJ-NEXT: AddressSize: 32bit
40 ; OBJ-NEXT: FileHeader {
41 ; OBJ-NEXT: Magic: 0x1DF
42 ; OBJ-NEXT: NumberOfSections: 2
43 ; OBJ-NEXT: TimeStamp:
44 ; OBJ-NEXT: SymbolTableOffset: 0x64
45 ; OBJ-NEXT: SymbolTableEntries: 16
46 ; OBJ-NEXT: OptionalHeaderSize: 0x0
47 ; OBJ-NEXT: Flags: 0x0
49 ; OBJ-NEXT: Sections [
52 ; OBJ-NEXT: Name: .text
53 ; OBJ-NEXT: PhysicalAddress: 0x0
54 ; OBJ-NEXT: VirtualAddress: 0x0
56 ; OBJ-NEXT: RawDataOffset: 0x64
57 ; OBJ-NEXT: RelocationPointer: 0x0
58 ; OBJ-NEXT: LineNumberPointer: 0x0
59 ; OBJ-NEXT: NumberOfRelocations: 0
60 ; OBJ-NEXT: NumberOfLineNumbers: 0
61 ; OBJ-NEXT: Type: STYP_TEXT (0x20)
65 ; OBJ-NEXT: Name: .bss
66 ; OBJ-NEXT: PhysicalAddress: 0x0
67 ; OBJ-NEXT: VirtualAddress: 0x0
68 ; OBJ-NEXT: Size: 0x6C
69 ; OBJ-NEXT: RawDataOffset: 0x0
70 ; OBJ-NEXT: RelocationPointer: 0x0
71 ; OBJ-NEXT: LineNumberPointer: 0x0
72 ; OBJ-NEXT: NumberOfRelocations: 0
73 ; OBJ-NEXT: NumberOfLineNumbers: 0
74 ; OBJ-NEXT: Type: STYP_BSS (0x80)
78 ; SYMS: File: {{.*}}aix-xcoff-common.ll.tmp.o
79 ; SYMS-NEXT: Format: aixcoff-rs6000
80 ; SYMS-NEXT: Arch: powerpc
81 ; SYMS-NEXT: AddressSize: 32bit
82 ; SYMS-NEXT: Symbols [
83 ; SYMS: Symbol {{[{][[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: a
84 ; SYMS-NEXT: Value (RelocatableAddress): 0x0
85 ; SYMS-NEXT: Section: .bss
86 ; SYMS-NEXT: Type: 0x0
87 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
88 ; SYMS-NEXT: NumberOfAuxEntries: 1
89 ; SYMS-NEXT: CSECT Auxiliary Entry {
90 ; SYMS-NEXT: Index: [[#Index + 1]]
91 ; SYMS-NEXT: SectionLen: 4
92 ; SYMS-NEXT: ParameterHashIndex: 0x0
93 ; SYMS-NEXT: TypeChkSectNum: 0x0
94 ; SYMS-NEXT: SymbolAlignmentLog2: 2
95 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
96 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
97 ; SYMS-NEXT: StabInfoIndex: 0x0
98 ; SYMS-NEXT: StabSectNum: 0x0
101 ; SYMS-NEXT: Symbol {
102 ; SYMS-NEXT: Index: [[#Index + 2]]
104 ; SYMS-NEXT: Value (RelocatableAddress): 0x8
105 ; SYMS-NEXT: Section: .bss
106 ; SYMS-NEXT: Type: 0x0
107 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
108 ; SYMS-NEXT: NumberOfAuxEntries: 1
109 ; SYMS-NEXT: CSECT Auxiliary Entry {
110 ; SYMS-NEXT: Index: [[#Index + 3]]
111 ; SYMS-NEXT: SectionLen: 8
112 ; SYMS-NEXT: ParameterHashIndex: 0x0
113 ; SYMS-NEXT: TypeChkSectNum: 0x0
114 ; SYMS-NEXT: SymbolAlignmentLog2: 3
115 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
116 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
117 ; SYMS-NEXT: StabInfoIndex: 0x0
118 ; SYMS-NEXT: StabSectNum: 0x0
121 ; SYMS-NEXT: Symbol {
122 ; SYMS-NEXT: Index: [[#Index + 4]]
124 ; SYMS-NEXT: Value (RelocatableAddress): 0x10
125 ; SYMS-NEXT: Section: .bss
126 ; SYMS-NEXT: Type: 0x0
127 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
128 ; SYMS-NEXT: NumberOfAuxEntries: 1
129 ; SYMS-NEXT: CSECT Auxiliary Entry {
130 ; SYMS-NEXT: Index: [[#Index + 5]]
131 ; SYMS-NEXT: SectionLen: 2
132 ; SYMS-NEXT: ParameterHashIndex: 0x0
133 ; SYMS-NEXT: TypeChkSectNum: 0x0
134 ; SYMS-NEXT: SymbolAlignmentLog2: 1
135 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
136 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
137 ; SYMS-NEXT: StabInfoIndex: 0x0
138 ; SYMS-NEXT: StabSectNum: 0x0
141 ; SYMS-NEXT: Symbol {
142 ; SYMS-NEXT: Index: [[#Index + 6]]
144 ; SYMS-NEXT: Value (RelocatableAddress): 0x18
145 ; SYMS-NEXT: Section: .bss
146 ; SYMS-NEXT: Type: 0x0
147 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
148 ; SYMS-NEXT: NumberOfAuxEntries: 1
149 ; SYMS-NEXT: CSECT Auxiliary Entry {
150 ; SYMS-NEXT: Index: [[#Index + 7]]
151 ; SYMS-NEXT: SectionLen: 8
152 ; SYMS-NEXT: ParameterHashIndex: 0x0
153 ; SYMS-NEXT: TypeChkSectNum: 0x0
154 ; SYMS-NEXT: SymbolAlignmentLog2: 3
155 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
156 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
157 ; SYMS-NEXT: StabInfoIndex: 0x0
158 ; SYMS-NEXT: StabSectNum: 0x0
161 ; SYMS-NEXT: Symbol {
162 ; SYMS-NEXT: Index: [[#Index + 8]]
164 ; SYMS-NEXT: Value (RelocatableAddress): 0x20
165 ; SYMS-NEXT: Section: .bss
166 ; SYMS-NEXT: Type: 0x0
167 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
168 ; SYMS-NEXT: NumberOfAuxEntries: 1
169 ; SYMS-NEXT: CSECT Auxiliary Entry {
170 ; SYMS-NEXT: Index: [[#Index + 9]]
171 ; SYMS-NEXT: SectionLen: 4
172 ; SYMS-NEXT: ParameterHashIndex: 0x0
173 ; SYMS-NEXT: TypeChkSectNum: 0x0
174 ; SYMS-NEXT: SymbolAlignmentLog2: 2
175 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
176 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
177 ; SYMS-NEXT: StabInfoIndex: 0x0
178 ; SYMS-NEXT: StabSectNum: 0x0
181 ; SYMS-NEXT: Symbol {
182 ; SYMS-NEXT: Index: [[#Index + 10]]
183 ; SYMS-NEXT: Name: over_aligned
184 ; SYMS-NEXT: Value (RelocatableAddress): 0x40
185 ; SYMS-NEXT: Section: .bss
186 ; SYMS-NEXT: Type: 0x0
187 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
188 ; SYMS-NEXT: NumberOfAuxEntries: 1
189 ; SYMS-NEXT: CSECT Auxiliary Entry {
190 ; SYMS-NEXT: Index: [[#Index + 11]]
191 ; SYMS-NEXT: SectionLen: 8
192 ; SYMS-NEXT: ParameterHashIndex: 0x0
193 ; SYMS-NEXT: TypeChkSectNum: 0x0
194 ; SYMS-NEXT: SymbolAlignmentLog2: 5
195 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
196 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
197 ; SYMS-NEXT: StabInfoIndex: 0x0
198 ; SYMS-NEXT: StabSectNum: 0x0
201 ; SYMS-NEXT: Symbol {
202 ; SYMS-NEXT: Index: [[#Index + 12]]
203 ; SYMS-NEXT: Name: array
204 ; SYMS-NEXT: Value (RelocatableAddress): 0x48
205 ; SYMS-NEXT: Section: .bss
206 ; SYMS-NEXT: Type: 0x0
207 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
208 ; SYMS-NEXT: NumberOfAuxEntries: 1
209 ; SYMS-NEXT: CSECT Auxiliary Entry {
210 ; SYMS-NEXT: Index: [[#Index + 13]]
211 ; SYMS-NEXT: SectionLen: 33
212 ; SYMS-NEXT: ParameterHashIndex: 0x0
213 ; SYMS-NEXT: TypeChkSectNum: 0x0
214 ; SYMS-NEXT: SymbolAlignmentLog2: 0
215 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
216 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
217 ; SYMS-NEXT: StabInfoIndex: 0x0
218 ; SYMS-NEXT: StabSectNum: 0x0