1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec -data-sections=false < %s | \
3 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec -data-sections=false < %s |\
6 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -filetype=obj %s -o %t.o
7 ; RUN: llvm-readobj --syms --auxiliary-header %t.o | FileCheck %s --check-prefixes=SYM,AUX32
9 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -filetype=obj %s -o %t64.o
10 ; RUN: llvm-readobj --syms --auxiliary-header %t64.o | FileCheck %s --check-prefixes=SYM,AUX64
12 @b = global i32 0, align 4
13 @b_h = hidden global i32 0, align 4
14 @b_e = dllexport global i32 0, align 4
21 define hidden void @foo_h(ptr %ip) {
26 define dllexport void @foo_e(ptr %ip) {
31 define protected void @foo_protected(ptr %ip) {
36 define weak hidden void @foo_weak_h() {
41 define weak dllexport void @foo_weak_e() {
46 @foo_p = global ptr @zoo_weak_extern_h, align 4
47 declare extern_weak hidden void @zoo_weak_extern_h()
48 declare extern_weak dllexport void @zoo_weak_extern_e()
52 %call1= call i32 @bar_h(ptr @b_h)
53 call void @foo_weak_h()
54 %0 = load ptr, ptr @foo_p, align 4
59 declare hidden i32 @bar_h(ptr)
60 declare dllexport i32 @bar_e(ptr)
62 ; CHECK: .globl foo[DS]{{[[:space:]]*([#].*)?$}}
63 ; CHECK: .globl .foo{{[[:space:]]*([#].*)?$}}
64 ; CHECK: .globl foo_h[DS],hidden
65 ; CHECK: .globl .foo_h,hidden
66 ; CHECK: .globl foo_e[DS],exported
67 ; CHECK: .globl .foo_e,exported
68 ; CHECK: .globl foo_protected[DS],protected
69 ; CHECK: .globl .foo_protected,protected
70 ; CHECK: .weak foo_weak_h[DS],hidden
71 ; CHECK: .weak .foo_weak_h,hidden
72 ; CHECK: .weak foo_weak_e[DS],exported
73 ; CHECK: .weak .foo_weak_e,exported
75 ; CHECK: .globl b{{[[:space:]]*([#].*)?$}}
76 ; CHECK: .globl b_h,hidden
77 ; CHECK: .globl b_e,exported
79 ; CHECK: .weak .zoo_weak_extern_h[PR],hidden
80 ; CHECK: .weak zoo_weak_extern_h[DS],hidden
81 ; CHECK: .weak .zoo_weak_extern_e[PR],exported
82 ; CHECK: .weak zoo_weak_extern_e[DS],exported
83 ; CHECK: .extern .bar_h[PR],hidden
84 ; CHECK: .extern bar_h[DS],hidden
85 ; CHECK: .extern .bar_e[PR],exported
86 ; CHECK: .extern bar_e[DS],exported
88 ; AUX32: AuxiliaryHeader {
89 ; AUX32-NEXT: Magic: 0x0
90 ; AUX32-NEXT: Version: 0x2
91 ; AUX32-NEXT: Size of .text section: 0x134
92 ; AUX32-NEXT: Size of .data section: 0x6C
93 ; AUX32-NEXT: Size of .bss section: 0x0
94 ; AUX32-NEXT: Entry point address: 0x0
95 ; AUX32-NEXT: .text section start address: 0x0
96 ; AUX32-NEXT: .data section start address: 0x134
99 ; AUX64: AuxiliaryHeader {
103 ; SYM-NEXT: Value (RelocatableAddress): 0x0
104 ; SYM-NEXT: Section: N_UNDEF
105 ; SYM-NEXT: Type: 0x2000
106 ; SYM-NEXT: StorageClass: C_EXT (0x2)
108 ; SYM: Name: zoo_weak_extern_h
109 ; SYM-NEXT: Value (RelocatableAddress): 0x0
110 ; SYM-NEXT: Section: N_UNDEF
111 ; SYM-NEXT: Type: 0x2000
112 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
114 ; SYM: Name: .zoo_weak_extern_h
115 ; SYM-NEXT: Value (RelocatableAddress): 0x0
116 ; SYM-NEXT: Section: N_UNDEF
117 ; SYM-NEXT: Type: 0x2000
118 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
120 ; SYM: Name: .zoo_weak_extern_e
121 ; SYM-NEXT: Value (RelocatableAddress): 0x0
122 ; SYM-NEXT: Section: N_UNDEF
123 ; SYM-NEXT: Type: 0x4000
124 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
126 ; SYM: Name: zoo_weak_extern_e
127 ; SYM-NEXT: Value (RelocatableAddress): 0x0
128 ; SYM-NEXT: Section: N_UNDEF
129 ; SYM-NEXT: Type: 0x4000
130 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
133 ; SYM-NEXT: Value (RelocatableAddress): 0x0
134 ; SYM-NEXT: Section: N_UNDEF
135 ; SYM-NEXT: Type: 0x2000
136 ; SYM-NEXT: StorageClass: C_EXT (0x2)
139 ; SYM-NEXT: Value (RelocatableAddress): 0x0
140 ; SYM-NEXT: Section: N_UNDEF
141 ; SYM-NEXT: Type: 0x4000
142 ; SYM-NEXT: StorageClass: C_EXT (0x2)
145 ; SYM-NEXT: Value (RelocatableAddress): 0x0
146 ; SYM-NEXT: Section: N_UNDEF
147 ; SYM-NEXT: Type: 0x4000
148 ; SYM-NEXT: StorageClass: C_EXT (0x2)
151 ; SYM-NEXT: Value (RelocatableAddress): 0x0
152 ; SYM-NEXT: Section: .text
153 ; SYM-NEXT: Type: 0x0
154 ; SYM-NEXT: StorageClass: C_EXT (0x2)
157 ; SYM-NEXT: Value (RelocatableAddress): 0x1C
158 ; SYM-NEXT: Section: .text
159 ; SYM-NEXT: Type: 0x2000
160 ; SYM-NEXT: StorageClass: C_EXT (0x2)
163 ; SYM-NEXT: Value (RelocatableAddress): 0x3C
164 ; SYM-NEXT: Section: .text
165 ; SYM-NEXT: Type: 0x4000
166 ; SYM-NEXT: StorageClass: C_EXT (0x2)
168 ; SYM: Name: .foo_protected
169 ; SYM-NEXT: Value (RelocatableAddress): 0x5C
170 ; SYM-NEXT: Section: .text
171 ; SYM-NEXT: Type: 0x3000
172 ; SYM-NEXT: StorageClass: C_EXT (0x2)
174 ; SYM: Name: .foo_weak_h
175 ; SYM-NEXT: Value (RelocatableAddress): 0x84
176 ; SYM-NEXT: Section: .text
177 ; SYM-NEXT: Type: 0x2000
178 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
180 ; SYM: Name: .foo_weak_e
181 ; SYM-NEXT: Value (RelocatableAddress): 0xA4
182 ; SYM-NEXT: Section: .text
183 ; SYM-NEXT: Type: 0x4000
184 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
187 ; SYM-NEXT: Value (RelocatableAddress): 0x134
188 ; SYM-NEXT: Section: .data
189 ; SYM-NEXT: Type: 0x0
190 ; SYM-NEXT: StorageClass: C_EXT (0x2)
193 ; SYM-NEXT: Value (RelocatableAddress): 0x138
194 ; SYM-NEXT: Section: .data
195 ; SYM-NEXT: Type: 0x2000
196 ; SYM-NEXT: StorageClass: C_EXT (0x2)
199 ; SYM-NEXT: Value (RelocatableAddress): 0x13C
200 ; SYM-NEXT: Section: .data
201 ; SYM-NEXT: Type: 0x4000
202 ; SYM-NEXT: StorageClass: C_EXT (0x2)
205 ; SYM-NEXT: Value (RelocatableAddress): {{[0-9]+}}
206 ; SYM-NEXT: Section: .data
207 ; SYM-NEXT: Type: 0x0
208 ; SYM-NEXT: StorageClass: C_EXT (0x2)
211 ; SYM-NEXT: Value (RelocatableAddress): {{[0-9]+}}
212 ; SYM-NEXT: Section: .data
213 ; SYM-NEXT: Type: 0x2000
214 ; SYM-NEXT: StorageClass: C_EXT (0x2)
217 ; SYM-NEXT: Value (RelocatableAddress): {{[0-9]+}}
218 ; SYM-NEXT: Section: .data
219 ; SYM-NEXT: Type: 0x4000
220 ; SYM-NEXT: StorageClass: C_EXT (0x2)
222 ; SYM: Name: foo_protected
223 ; SYM-NEXT: Value (RelocatableAddress): {{[0-9]+}}
224 ; SYM-NEXT: Section: .data
225 ; SYM-NEXT: Type: 0x3000
226 ; SYM-NEXT: StorageClass: C_EXT (0x2)
228 ; SYM: Name: foo_weak_h
229 ; SYM-NEXT: Value (RelocatableAddress): {{[0-9]+}}
230 ; SYM-NEXT: Section: .data
231 ; SYM-NEXT: Type: 0x2000
232 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
234 ; SYM: Name: foo_weak_e
235 ; SYM-NEXT: Value (RelocatableAddress): {{[0-9]+}}
236 ; SYM-NEXT: Section: .data
237 ; SYM-NEXT: Type: 0x4000
238 ; SYM-NEXT: StorageClass: C_WEAKEXT (0x6F)