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
24 ; CHECK: .csect .text[PR]
26 ; CHECK-NEXT: .comm a,4,2
27 ; CHECK-NEXT: .comm b,8,3
28 ; CHECK-NEXT: .comm c,2,1
29 ; CHECK-NEXT: .comm d,8,3
30 ; CHECK-NEXT: .comm f,4,2
31 ; CHECK-NEXT: .comm over_aligned,8,5
32 ; CHECK-NEXT: .comm array,33,0
34 ; OBJ: File: {{.*}}aix-xcoff-common.ll.tmp.o
35 ; OBJ-NEXT: Format: aixcoff-rs6000
36 ; OBJ-NEXT: Arch: powerpc
37 ; OBJ-NEXT: AddressSize: 32bit
38 ; OBJ-NEXT: FileHeader {
39 ; OBJ-NEXT: Magic: 0x1DF
40 ; OBJ-NEXT: NumberOfSections: 1
41 ; OBJ-NEXT: TimeStamp:
42 ; OBJ-NEXT: SymbolTableOffset: 0x3C
43 ; OBJ-NEXT: SymbolTableEntries: 14
44 ; OBJ-NEXT: OptionalHeaderSize: 0x0
45 ; OBJ-NEXT: Flags: 0x0
47 ; OBJ-NEXT: Sections [
50 ; OBJ-NEXT: Name: .bss
51 ; OBJ-NEXT: PhysicalAddress: 0x0
52 ; OBJ-NEXT: VirtualAddress: 0x0
53 ; OBJ-NEXT: Size: 0x6C
54 ; OBJ-NEXT: RawDataOffset: 0x0
55 ; OBJ-NEXT: RelocationPointer: 0x0
56 ; OBJ-NEXT: LineNumberPointer: 0x0
57 ; OBJ-NEXT: NumberOfRelocations: 0
58 ; OBJ-NEXT: NumberOfLineNumbers: 0
59 ; OBJ-NEXT: Type: STYP_BSS (0x80)
63 ; SYMS: File: {{.*}}aix-xcoff-common.ll.tmp.o
64 ; SYMS-NEXT: Format: aixcoff-rs6000
65 ; SYMS-NEXT: Arch: powerpc
66 ; SYMS-NEXT: AddressSize: 32bit
67 ; SYMS-NEXT: Symbols [
69 ; SYMS-NEXT: Index: [[#Index:]]
71 ; SYMS-NEXT: Value (RelocatableAddress): 0x0
72 ; SYMS-NEXT: Section: .bss
73 ; SYMS-NEXT: Type: 0x0
74 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
75 ; SYMS-NEXT: NumberOfAuxEntries: 1
76 ; SYMS-NEXT: CSECT Auxiliary Entry {
77 ; SYMS-NEXT: Index: [[#Index + 1]]
78 ; SYMS-NEXT: SectionLen: 4
79 ; SYMS-NEXT: ParameterHashIndex: 0x0
80 ; SYMS-NEXT: TypeChkSectNum: 0x0
81 ; SYMS-NEXT: SymbolAlignmentLog2: 2
82 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
83 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
84 ; SYMS-NEXT: StabInfoIndex: 0x0
85 ; SYMS-NEXT: StabSectNum: 0x0
89 ; SYMS-NEXT: Index: [[#Index + 2]]
91 ; SYMS-NEXT: Value (RelocatableAddress): 0x8
92 ; SYMS-NEXT: Section: .bss
93 ; SYMS-NEXT: Type: 0x0
94 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
95 ; SYMS-NEXT: NumberOfAuxEntries: 1
96 ; SYMS-NEXT: CSECT Auxiliary Entry {
97 ; SYMS-NEXT: Index: [[#Index + 3]]
98 ; SYMS-NEXT: SectionLen: 8
99 ; SYMS-NEXT: ParameterHashIndex: 0x0
100 ; SYMS-NEXT: TypeChkSectNum: 0x0
101 ; SYMS-NEXT: SymbolAlignmentLog2: 3
102 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
103 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
104 ; SYMS-NEXT: StabInfoIndex: 0x0
105 ; SYMS-NEXT: StabSectNum: 0x0
108 ; SYMS-NEXT: Symbol {
109 ; SYMS-NEXT: Index: [[#Index + 4]]
111 ; SYMS-NEXT: Value (RelocatableAddress): 0x10
112 ; SYMS-NEXT: Section: .bss
113 ; SYMS-NEXT: Type: 0x0
114 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
115 ; SYMS-NEXT: NumberOfAuxEntries: 1
116 ; SYMS-NEXT: CSECT Auxiliary Entry {
117 ; SYMS-NEXT: Index: [[#Index + 5]]
118 ; SYMS-NEXT: SectionLen: 2
119 ; SYMS-NEXT: ParameterHashIndex: 0x0
120 ; SYMS-NEXT: TypeChkSectNum: 0x0
121 ; SYMS-NEXT: SymbolAlignmentLog2: 1
122 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
123 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
124 ; SYMS-NEXT: StabInfoIndex: 0x0
125 ; SYMS-NEXT: StabSectNum: 0x0
128 ; SYMS-NEXT: Symbol {
129 ; SYMS-NEXT: Index: [[#Index + 6]]
131 ; SYMS-NEXT: Value (RelocatableAddress): 0x18
132 ; SYMS-NEXT: Section: .bss
133 ; SYMS-NEXT: Type: 0x0
134 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
135 ; SYMS-NEXT: NumberOfAuxEntries: 1
136 ; SYMS-NEXT: CSECT Auxiliary Entry {
137 ; SYMS-NEXT: Index: [[#Index + 7]]
138 ; SYMS-NEXT: SectionLen: 8
139 ; SYMS-NEXT: ParameterHashIndex: 0x0
140 ; SYMS-NEXT: TypeChkSectNum: 0x0
141 ; SYMS-NEXT: SymbolAlignmentLog2: 3
142 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
143 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
144 ; SYMS-NEXT: StabInfoIndex: 0x0
145 ; SYMS-NEXT: StabSectNum: 0x0
148 ; SYMS-NEXT: Symbol {
149 ; SYMS-NEXT: Index: [[#Index + 8]]
151 ; SYMS-NEXT: Value (RelocatableAddress): 0x20
152 ; SYMS-NEXT: Section: .bss
153 ; SYMS-NEXT: Type: 0x0
154 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
155 ; SYMS-NEXT: NumberOfAuxEntries: 1
156 ; SYMS-NEXT: CSECT Auxiliary Entry {
157 ; SYMS-NEXT: Index: [[#Index + 9]]
158 ; SYMS-NEXT: SectionLen: 4
159 ; SYMS-NEXT: ParameterHashIndex: 0x0
160 ; SYMS-NEXT: TypeChkSectNum: 0x0
161 ; SYMS-NEXT: SymbolAlignmentLog2: 2
162 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
163 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
164 ; SYMS-NEXT: StabInfoIndex: 0x0
165 ; SYMS-NEXT: StabSectNum: 0x0
168 ; SYMS-NEXT: Symbol {
169 ; SYMS-NEXT: Index: [[#Index + 10]]
170 ; SYMS-NEXT: Name: over_aligned
171 ; SYMS-NEXT: Value (RelocatableAddress): 0x40
172 ; SYMS-NEXT: Section: .bss
173 ; SYMS-NEXT: Type: 0x0
174 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
175 ; SYMS-NEXT: NumberOfAuxEntries: 1
176 ; SYMS-NEXT: CSECT Auxiliary Entry {
177 ; SYMS-NEXT: Index: [[#Index + 11]]
178 ; SYMS-NEXT: SectionLen: 8
179 ; SYMS-NEXT: ParameterHashIndex: 0x0
180 ; SYMS-NEXT: TypeChkSectNum: 0x0
181 ; SYMS-NEXT: SymbolAlignmentLog2: 5
182 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
183 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
184 ; SYMS-NEXT: StabInfoIndex: 0x0
185 ; SYMS-NEXT: StabSectNum: 0x0
188 ; SYMS-NEXT: Symbol {
189 ; SYMS-NEXT: Index: [[#Index + 12]]
190 ; SYMS-NEXT: Name: array
191 ; SYMS-NEXT: Value (RelocatableAddress): 0x48
192 ; SYMS-NEXT: Section: .bss
193 ; SYMS-NEXT: Type: 0x0
194 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
195 ; SYMS-NEXT: NumberOfAuxEntries: 1
196 ; SYMS-NEXT: CSECT Auxiliary Entry {
197 ; SYMS-NEXT: Index: [[#Index + 13]]
198 ; SYMS-NEXT: SectionLen: 33
199 ; SYMS-NEXT: ParameterHashIndex: 0x0
200 ; SYMS-NEXT: TypeChkSectNum: 0x0
201 ; SYMS-NEXT: SymbolAlignmentLog2: 0
202 ; SYMS-NEXT: SymbolType: XTY_CM (0x3)
203 ; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
204 ; SYMS-NEXT: StabInfoIndex: 0x0
205 ; SYMS-NEXT: StabSectNum: 0x0