1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
2 ; RUN: -mattr=-altivec -function-sections < %s | \
3 ; RUN: FileCheck --check-prefix=ASM %s
4 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
5 ; RUN: -mattr=-altivec -function-sections < %s | \
6 ; RUN: FileCheck --check-prefix=ASM %s
8 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
9 ; RUN: -mattr=-altivec -function-sections -xcoff-traceback-table=true \
10 ; RUN: -filetype=obj -o %t32.o < %s
11 ; RUN: llvm-objdump --syms --reloc --symbol-description %t32.o | \
12 ; RUN: FileCheck --check-prefix=XCOFF32 %s
13 ; RUN: llvm-objdump -dr --symbol-description %t32.o | \
14 ; RUN: FileCheck --check-prefix=DIS32 %s
16 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
17 ; RUN: -mattr=-altivec -function-sections -xcoff-traceback-table=true \
18 ; RUN: -filetype=obj -o %t64.o < %s
19 ; RUN: llvm-objdump --syms --reloc --symbol-description %t64.o | \
20 ; RUN: FileCheck --check-prefix=XCOFF64 %s
21 ; RUN: llvm-objdump -dr --symbol-description %t64.o | \
22 ; RUN: FileCheck --check-prefix=DIS64 %s
24 @alias_foo = alias void (...), ptr @foo
31 define hidden void @hidden_foo() {
39 call void @static_overalign_foo()
40 call void @alias_foo()
41 call void @extern_foo()
42 call void @hidden_foo()
46 declare void @extern_foo(...)
48 define internal void @static_overalign_foo() align 64 {
53 ; ASM: .csect .foo[PR],5
54 ; ASM-NEXT: .globl foo[DS] # -- Begin function foo
55 ; ASM-NEXT: .globl .foo[PR]
57 ; ASM-NEXT: .csect foo[DS]
58 ; ASM-NEXT: alias_foo: # @foo
59 ; ASM-NEXT: .vbyte {{[0-9]+}}, .foo[PR]
60 ; ASM-NEXT: .vbyte {{[0-9]+}}, TOC[TC0]
61 ; ASM-NEXT: .vbyte {{[0-9]+}}, 0
62 ; ASM-NEXT: .csect .foo[PR],5
63 ; ASM-NEXT: .alias_foo:
64 ; ASM-NEXT: # %bb.0: # %entry
66 ; ASM: .csect .hidden_foo[PR],5
67 ; ASM-NEXT: .globl hidden_foo[DS],hidden # -- Begin function hidden_foo
68 ; ASM-NEXT: .globl .hidden_foo[PR],hidden
70 ; ASM-NEXT: .csect hidden_foo[DS]
71 ; ASM-NEXT: .vbyte {{[0-9]+}}, .hidden_foo[PR] # @hidden_foo
72 ; ASM-NEXT: .vbyte {{[0-9]+}}, TOC[TC0]
73 ; ASM-NEXT: .vbyte {{[0-9]+}}, 0
74 ; ASM-NEXT: .csect .hidden_foo[PR]
75 ; ASM-NEXT: # %bb.0: # %entry
77 ; ASM: .csect .bar[PR],5
78 ; ASM-NEXT: .globl bar[DS] # -- Begin function bar
79 ; ASM-NEXT: .globl .bar[PR]
81 ; ASM-NEXT: .csect bar[DS]
82 ; ASM-NEXT: .vbyte {{[0-9]+}}, .bar[PR] # @bar
83 ; ASM-NEXT: .vbyte {{[0-9]+}}, TOC[TC0]
84 ; ASM-NEXT: .vbyte {{[0-9]+}}, 0
85 ; ASM-NEXT: .csect .bar[PR],5
86 ; ASM-NEXT: # %bb.0: # %entry
89 ; ASM-NEXT: bl .static_overalign_foo[PR]
91 ; ASM-NEXT: bl .alias_foo
93 ; ASM-NEXT: bl .extern_foo
95 ; ASM-NEXT: bl .hidden_foo[PR]
97 ; ASM: .csect .static_overalign_foo[PR],6
98 ; ASM-NEXT: .lglobl static_overalign_foo[DS] # -- Begin function static_overalign_foo
99 ; ASM-NEXT: .lglobl .static_overalign_foo[PR]
101 ; ASM-NEXT: .csect static_overalign_foo[DS]
102 ; ASM-NEXT: .vbyte {{[0-9]+}}, .static_overalign_foo[PR] # @static_overalign_foo
103 ; ASM-NEXT: .vbyte {{[0-9]+}}, TOC[TC0]
104 ; ASM-NEXT: .vbyte {{[0-9]+}}, 0
105 ; ASM-NEXT: .csect .static_overalign_foo[PR],6
106 ; ASM-NEXT: # %bb.0: # %entry
108 ; ASM: .extern .extern_foo
109 ; ASM-NEXT: .extern extern_foo[DS]
110 ; ASM-NEXT: .globl alias_foo
111 ; ASM-NEXT: .globl .alias_foo
113 ; XCOFF32: SYMBOL TABLE:
114 ; XCOFF32-NEXT: 00000000 df *DEBUG* 00000000 (idx: 0) <stdin>
115 ; XCOFF32-NEXT: 00000000 *UND* 00000000 (idx: 1) .extern_foo[PR]
116 ; XCOFF32-NEXT: 00000000 *UND* 00000000 (idx: 3) extern_foo[DS]
117 ; XCOFF32-NEXT: 00000000 l .text 00000000 (idx: 5) [PR]
118 ; XCOFF32-NEXT: 00000000 g .text 00000019 (idx: 7) .foo[PR]
119 ; XCOFF32-NEXT: 00000000 g F .text (csect: (idx: 7) .foo[PR]) 00000000 (idx: 9) .alias_foo
120 ; XCOFF32-NEXT: 00000020 g .text 00000020 .hidden (idx: 11) .hidden_foo[PR]
121 ; XCOFF32-NEXT: 00000040 g .text 00000059 (idx: 13) .bar[PR]
122 ; XCOFF32-NEXT: 000000c0 l .text 0000002a (idx: 15) .static_overalign_foo[PR]
123 ; XCOFF32-NEXT: 000000ec g O .data 0000000c (idx: 17) foo[DS]
124 ; XCOFF32-NEXT: 000000ec g O .data (csect: (idx: 17) foo[DS]) 00000000 (idx: 19) alias_foo
125 ; XCOFF32-NEXT: 000000f8 g O .data 0000000c .hidden (idx: 21) hidden_foo[DS]
126 ; XCOFF32-NEXT: 00000104 g O .data 0000000c (idx: 23) bar[DS]
127 ; XCOFF32-NEXT: 00000110 l O .data 0000000c (idx: 25) static_overalign_foo[DS]
128 ; XCOFF32-NEXT: 0000011c l .data 00000000 (idx: 27) TOC[TC0]
130 ; XCOFF32: RELOCATION RECORDS FOR [.text]:
131 ; XCOFF32-NEXT: OFFSET TYPE VALUE
132 ; XCOFF32-NEXT: 0000004c R_RBR (idx: 7) .foo[PR]
133 ; XCOFF32-NEXT: 00000054 R_RBR (idx: 15) .static_overalign_foo[PR]
134 ; XCOFF32-NEXT: 0000005c R_RBR (idx: 9) .alias_foo
135 ; XCOFF32-NEXT: 00000064 R_RBR (idx: 1) .extern_foo[PR]
136 ; XCOFF32-NEXT: 0000006c R_RBR (idx: 11) .hidden_foo[PR]
137 ; XCOFF32: RELOCATION RECORDS FOR [.data]:
138 ; XCOFF32-NEXT: OFFSET TYPE VALUE
139 ; XCOFF32-NEXT: 00000000 R_POS (idx: 7) .foo[PR]
140 ; XCOFF32-NEXT: 00000004 R_POS (idx: 27) TOC[TC0]
141 ; XCOFF32-NEXT: 0000000c R_POS (idx: 11) .hidden_foo[PR]
142 ; XCOFF32-NEXT: 00000010 R_POS (idx: 27) TOC[TC0]
143 ; XCOFF32-NEXT: 00000018 R_POS (idx: 13) .bar[PR]
144 ; XCOFF32-NEXT: 0000001c R_POS (idx: 27) TOC[TC0]
145 ; XCOFF32-NEXT: 00000024 R_POS (idx: 15) .static_overalign_foo[PR]
146 ; XCOFF32-NEXT: 00000028 R_POS (idx: 27) TOC[TC0]
148 ; XCOFF64: SYMBOL TABLE:
149 ; XCOFF64-NEXT: 0000000000000000 df *DEBUG* 0000000000000000 (idx: 0) <stdin>
150 ; XCOFF64-NEXT: 0000000000000000 *UND* 0000000000000000 (idx: 1) .extern_foo[PR]
151 ; XCOFF64-NEXT: 0000000000000000 *UND* 0000000000000000 (idx: 3) extern_foo[DS]
152 ; XCOFF64-NEXT: 0000000000000000 l .text 0000000000000000 (idx: 5) [PR]
153 ; XCOFF64-NEXT: 0000000000000000 g .text 0000000000000019 (idx: 7) .foo[PR]
154 ; XCOFF64-NEXT: 0000000000000000 g F .text (csect: (idx: 7) .foo[PR]) 0000000000000000 (idx: 9) .alias_foo
155 ; XCOFF64-NEXT: 0000000000000020 g .text 0000000000000020 .hidden (idx: 11) .hidden_foo[PR]
156 ; XCOFF64-NEXT: 0000000000000040 g .text 0000000000000059 (idx: 13) .bar[PR]
157 ; XCOFF64-NEXT: 00000000000000c0 l .text 000000000000002a (idx: 15) .static_overalign_foo[PR]
158 ; XCOFF64-NEXT: 00000000000000f0 g O .data 0000000000000018 (idx: 17) foo[DS]
159 ; XCOFF64-NEXT: 00000000000000f0 g O .data (csect: (idx: 17) foo[DS]) 0000000000000000 (idx: 19) alias_foo
160 ; XCOFF64-NEXT: 0000000000000108 g O .data 0000000000000018 .hidden (idx: 21) hidden_foo[DS]
161 ; XCOFF64-NEXT: 0000000000000120 g O .data 0000000000000018 (idx: 23) bar[DS]
162 ; XCOFF64-NEXT: 0000000000000138 l O .data 0000000000000018 (idx: 25) static_overalign_foo[DS]
163 ; XCOFF64-NEXT: 0000000000000150 l .data 0000000000000000 (idx: 27) TOC[TC0]
165 ; XCOFF64: RELOCATION RECORDS FOR [.text]:
166 ; XCOFF64-NEXT: OFFSET TYPE VALUE
167 ; XCOFF64-NEXT: 000000000000004c R_RBR (idx: 7) .foo[PR]
168 ; XCOFF64-NEXT: 0000000000000054 R_RBR (idx: 15) .static_overalign_foo[PR]
169 ; XCOFF64-NEXT: 000000000000005c R_RBR (idx: 9) .alias_foo
170 ; XCOFF64-NEXT: 0000000000000064 R_RBR (idx: 1) .extern_foo[PR]
171 ; XCOFF64-NEXT: 000000000000006c R_RBR (idx: 11) .hidden_foo[PR]
172 ; XCOFF64: RELOCATION RECORDS FOR [.data]:
173 ; XCOFF64-NEXT: OFFSET TYPE VALUE
174 ; XCOFF64-NEXT: 0000000000000000 R_POS (idx: 7) .foo[PR]
175 ; XCOFF64-NEXT: 0000000000000008 R_POS (idx: 27) TOC[TC0]
176 ; XCOFF64-NEXT: 0000000000000018 R_POS (idx: 11) .hidden_foo[PR]
177 ; XCOFF64-NEXT: 0000000000000020 R_POS (idx: 27) TOC[TC0]
178 ; XCOFF64-NEXT: 0000000000000030 R_POS (idx: 13) .bar[PR]
179 ; XCOFF64-NEXT: 0000000000000038 R_POS (idx: 27) TOC[TC0]
180 ; XCOFF64-NEXT: 0000000000000048 R_POS (idx: 15) .static_overalign_foo[PR]
181 ; XCOFF64-NEXT: 0000000000000050 R_POS (idx: 27) TOC[TC0]
183 ; DIS32: Disassembly of section .text:
184 ; DIS32: 00000000 (idx: 9) .alias_foo:
185 ; DIS32: 00000020 (idx: 11) .hidden_foo[PR]:
186 ; DIS32: 00000040 (idx: 13) .bar[PR]:
187 ; DIS32-NEXT: 40: 7c 08 02 a6 mflr 0
188 ; DIS32-NEXT: 44: 94 21 ff c0 stwu 1, -64(1)
189 ; DIS32-NEXT: 48: 90 01 00 48 stw 0, 72(1)
190 ; DIS32-NEXT: 4c: 4b ff ff b5 bl 0x0 <.alias_foo>
191 ; DIS32-NEXT: 0000004c: R_RBR (idx: 7) .foo[PR]
192 ; DIS32-NEXT: 50: 60 00 00 00 nop
193 ; DIS32-NEXT: 54: 48 00 00 6d bl 0xc0 <.static_overalign_foo>
194 ; DIS32-NEXT: 00000054: R_RBR (idx: 15) .static_overalign_foo[PR]
195 ; DIS32-NEXT: 58: 60 00 00 00 nop
196 ; DIS32-NEXT: 5c: 4b ff ff a5 bl 0x0 <.alias_foo>
197 ; DIS32-NEXT: 0000005c: R_RBR (idx: 9) .alias_foo
198 ; DIS32-NEXT: 60: 60 00 00 00 nop
199 ; DIS32-NEXT: 64: 4b ff ff 9d bl 0x0 <.alias_foo>
200 ; DIS32-NEXT: 00000064: R_RBR (idx: 1) .extern_foo[PR]
201 ; DIS32-NEXT: 68: 60 00 00 00 nop
202 ; DIS32-NEXT: 6c: 4b ff ff b5 bl 0x20 <.hidden_foo>
203 ; DIS32-NEXT: 0000006c: R_RBR (idx: 11) .hidden_foo[PR]
204 ; DIS32: 000000c0 (idx: 15) .static_overalign_foo[PR]:
206 ; DIS64: Disassembly of section .text:
207 ; DIS64: 0000000000000000 (idx: 9) .alias_foo:
208 ; DIS64: 0000000000000020 (idx: 11) .hidden_foo[PR]:
209 ; DIS64: 0000000000000040 (idx: 13) .bar[PR]:
210 ; DIS64-NEXT: 40: 7c 08 02 a6 mflr 0
211 ; DIS64-NEXT: 44: f8 21 ff 91 stdu 1, -112(1)
212 ; DIS64-NEXT: 48: f8 01 00 80 std 0, 128(1)
213 ; DIS64-NEXT: 4c: 4b ff ff b5 bl 0x0 <.alias_foo>
214 ; DIS64-NEXT: 000000000000004c: R_RBR (idx: 7) .foo[PR]
215 ; DIS64-NEXT: 50: 60 00 00 00 nop
216 ; DIS64-NEXT: 54: 48 00 00 6d bl 0xc0 <.static_overalign_foo>
217 ; DIS64-NEXT: 0000000000000054: R_RBR (idx: 15) .static_overalign_foo[PR]
218 ; DIS64-NEXT: 58: 60 00 00 00 nop
219 ; DIS64-NEXT: 5c: 4b ff ff a5 bl 0x0 <.alias_foo>
220 ; DIS64-NEXT: 000000000000005c: R_RBR (idx: 9) .alias_foo
221 ; DIS64-NEXT: 60: 60 00 00 00 nop
222 ; DIS64-NEXT: 64: 4b ff ff 9d bl 0x0 <.alias_foo>
223 ; DIS64-NEXT: 0000000000000064: R_RBR (idx: 1) .extern_foo[PR]
224 ; DIS64-NEXT: 68: 60 00 00 00 nop
225 ; DIS64-NEXT: 6c: 4b ff ff b5 bl 0x20 <.hidden_foo>
226 ; DIS64-NEXT: 000000000000006c: R_RBR (idx: 11) .hidden_foo[PR]
227 ; DIS64: 00000000000000c0 (idx: 15) .static_overalign_foo[PR]: