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: 1
43 ; OBJ-NEXT: TimeStamp:
44 ; OBJ-NEXT: SymbolTableOffset: 0x3C
45 ; OBJ-NEXT: SymbolTableEntries: 14
46 ; OBJ-NEXT: OptionalHeaderSize: 0x0
47 ; OBJ-NEXT: Flags: 0x0
49 ; OBJ-NEXT: Sections [
52 ; OBJ-NEXT: Name: .bss
53 ; OBJ-NEXT: PhysicalAddress: 0x0
54 ; OBJ-NEXT: VirtualAddress: 0x0
55 ; OBJ-NEXT: Size: 0x6C
56 ; OBJ-NEXT: RawDataOffset: 0x0
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_BSS (0x80)
65 ; SYMS: File: {{.*}}aix-xcoff-common.ll.tmp.o
66 ; SYMS-NEXT: Format: aixcoff-rs6000
67 ; SYMS-NEXT: Arch: powerpc
68 ; SYMS-NEXT: AddressSize: 32bit
69 ; SYMS-NEXT: Symbols [
71 ; SYMS-NEXT: Index: [[#Index:]]
73 ; SYMS-NEXT: Value (RelocatableAddress): 0x0
74 ; SYMS-NEXT: Section: .bss
75 ; SYMS-NEXT: Type: 0x0
76 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
77 ; SYMS-NEXT: NumberOfAuxEntries: 1
78 ; SYMS-NEXT: CSECT Auxiliary Entry {
79 ; SYMS-NEXT: Index: [[#Index + 1]]
80 ; SYMS-NEXT: SectionLen: 4
81 ; SYMS-NEXT: ParameterHashIndex: 0x0
82 ; SYMS-NEXT: TypeChkSectNum: 0x0
83 ; SYMS-NEXT: SymbolAlignmentLog2: 2
84 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
85 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
86 ; SYMS-NEXT: StabInfoIndex: 0x0
87 ; SYMS-NEXT: StabSectNum: 0x0
91 ; SYMS-NEXT: Index: [[#Index + 2]]
93 ; SYMS-NEXT: Value (RelocatableAddress): 0x8
94 ; SYMS-NEXT: Section: .bss
95 ; SYMS-NEXT: Type: 0x0
96 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
97 ; SYMS-NEXT: NumberOfAuxEntries: 1
98 ; SYMS-NEXT: CSECT Auxiliary Entry {
99 ; SYMS-NEXT: Index: [[#Index + 3]]
100 ; SYMS-NEXT: SectionLen: 8
101 ; SYMS-NEXT: ParameterHashIndex: 0x0
102 ; SYMS-NEXT: TypeChkSectNum: 0x0
103 ; SYMS-NEXT: SymbolAlignmentLog2: 3
104 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
105 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
106 ; SYMS-NEXT: StabInfoIndex: 0x0
107 ; SYMS-NEXT: StabSectNum: 0x0
110 ; SYMS-NEXT: Symbol {
111 ; SYMS-NEXT: Index: [[#Index + 4]]
113 ; SYMS-NEXT: Value (RelocatableAddress): 0x10
114 ; SYMS-NEXT: Section: .bss
115 ; SYMS-NEXT: Type: 0x0
116 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
117 ; SYMS-NEXT: NumberOfAuxEntries: 1
118 ; SYMS-NEXT: CSECT Auxiliary Entry {
119 ; SYMS-NEXT: Index: [[#Index + 5]]
120 ; SYMS-NEXT: SectionLen: 2
121 ; SYMS-NEXT: ParameterHashIndex: 0x0
122 ; SYMS-NEXT: TypeChkSectNum: 0x0
123 ; SYMS-NEXT: SymbolAlignmentLog2: 1
124 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
125 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
126 ; SYMS-NEXT: StabInfoIndex: 0x0
127 ; SYMS-NEXT: StabSectNum: 0x0
130 ; SYMS-NEXT: Symbol {
131 ; SYMS-NEXT: Index: [[#Index + 6]]
133 ; SYMS-NEXT: Value (RelocatableAddress): 0x18
134 ; SYMS-NEXT: Section: .bss
135 ; SYMS-NEXT: Type: 0x0
136 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
137 ; SYMS-NEXT: NumberOfAuxEntries: 1
138 ; SYMS-NEXT: CSECT Auxiliary Entry {
139 ; SYMS-NEXT: Index: [[#Index + 7]]
140 ; SYMS-NEXT: SectionLen: 8
141 ; SYMS-NEXT: ParameterHashIndex: 0x0
142 ; SYMS-NEXT: TypeChkSectNum: 0x0
143 ; SYMS-NEXT: SymbolAlignmentLog2: 3
144 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
145 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
146 ; SYMS-NEXT: StabInfoIndex: 0x0
147 ; SYMS-NEXT: StabSectNum: 0x0
150 ; SYMS-NEXT: Symbol {
151 ; SYMS-NEXT: Index: [[#Index + 8]]
153 ; SYMS-NEXT: Value (RelocatableAddress): 0x20
154 ; SYMS-NEXT: Section: .bss
155 ; SYMS-NEXT: Type: 0x0
156 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
157 ; SYMS-NEXT: NumberOfAuxEntries: 1
158 ; SYMS-NEXT: CSECT Auxiliary Entry {
159 ; SYMS-NEXT: Index: [[#Index + 9]]
160 ; SYMS-NEXT: SectionLen: 4
161 ; SYMS-NEXT: ParameterHashIndex: 0x0
162 ; SYMS-NEXT: TypeChkSectNum: 0x0
163 ; SYMS-NEXT: SymbolAlignmentLog2: 2
164 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
165 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
166 ; SYMS-NEXT: StabInfoIndex: 0x0
167 ; SYMS-NEXT: StabSectNum: 0x0
170 ; SYMS-NEXT: Symbol {
171 ; SYMS-NEXT: Index: [[#Index + 10]]
172 ; SYMS-NEXT: Name: over_aligned
173 ; SYMS-NEXT: Value (RelocatableAddress): 0x40
174 ; SYMS-NEXT: Section: .bss
175 ; SYMS-NEXT: Type: 0x0
176 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
177 ; SYMS-NEXT: NumberOfAuxEntries: 1
178 ; SYMS-NEXT: CSECT Auxiliary Entry {
179 ; SYMS-NEXT: Index: [[#Index + 11]]
180 ; SYMS-NEXT: SectionLen: 8
181 ; SYMS-NEXT: ParameterHashIndex: 0x0
182 ; SYMS-NEXT: TypeChkSectNum: 0x0
183 ; SYMS-NEXT: SymbolAlignmentLog2: 5
184 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
185 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
186 ; SYMS-NEXT: StabInfoIndex: 0x0
187 ; SYMS-NEXT: StabSectNum: 0x0
190 ; SYMS-NEXT: Symbol {
191 ; SYMS-NEXT: Index: [[#Index + 12]]
192 ; SYMS-NEXT: Name: array
193 ; SYMS-NEXT: Value (RelocatableAddress): 0x48
194 ; SYMS-NEXT: Section: .bss
195 ; SYMS-NEXT: Type: 0x0
196 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
197 ; SYMS-NEXT: NumberOfAuxEntries: 1
198 ; SYMS-NEXT: CSECT Auxiliary Entry {
199 ; SYMS-NEXT: Index: [[#Index + 13]]
200 ; SYMS-NEXT: SectionLen: 33
201 ; SYMS-NEXT: ParameterHashIndex: 0x0
202 ; SYMS-NEXT: TypeChkSectNum: 0x0
203 ; SYMS-NEXT: SymbolAlignmentLog2: 0
204 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
205 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
206 ; SYMS-NEXT: StabInfoIndex: 0x0
207 ; SYMS-NEXT: StabSectNum: 0x0