[Frontend] Remove unused includes (NFC) (#116927)
[llvm-project.git] / llvm / test / tools / llvm-ml / indirect_branch.asm
blob12c847c47df0e3ffa61434f50f941daedf731a52
1 ; RUN: llvm-ml -m64 -filetype=s %s /Fo - | FileCheck %s --check-prefixes=CHECK-64,CHECK
2 ; RUN: llvm-ml -m32 -filetype=s %s /Fo - | FileCheck %s --check-prefixes=CHECK-32,CHECK
4 ifdef rax
5 extern fn_ref_extern : qword
6 else
7 extern fn_ref_extern : dword
8 endif
10 extern fn_proc_extern : proc
11 extern fn_ref_extern_word : word
13 .data
15 ifdef rax
16 fn_ref qword 1
17 else
18 fn_ref dword 1
19 endif
21 fn_ref_word word 2
22 fn PROC
24 BranchTargetStruc struc
25 member0 dword ?
26 ifdef rax
27 member1 dword ?
28 endif
29 BranchTargetStruc ends
32 ifdef rax
33 fn_ref_struc BranchTargetStruc {3, 3}
34 else
35 fn_ref_struc BranchTargetStruc {3}
36 endif
38 .code
40 t0:
41 call fn_ref
42 jmp fn_ref
43 ; CHECK-LABEL: t0:
44 ; CHECK-64: call qword ptr [rip + fn_ref]
45 ; CHECK-64: jmp qword ptr [rip + fn_ref]
46 ; CHECK-32: call dword ptr [fn_ref]
47 ; CHECK-32: jmp dword ptr [fn_ref]
49 t1:
50 call [fn_ref]
51 jmp [fn_ref]
52 ; CHECK-LABEL: t1:
53 ; CHECK-64: call qword ptr [rip + fn_ref]
54 ; CHECK-64: jmp qword ptr [rip + fn_ref]
55 ; CHECK-32: call dword ptr [fn_ref]
56 ; CHECK-32: jmp dword ptr [fn_ref]
58 ifdef rax
59 t2:
60 call qword ptr [fn_ref]
61 jmp qword ptr [fn_ref]
62 ; CHECK-64-LABEL: t2:
63 ; CHECK-64: call qword ptr [rip + fn_ref]
64 ; CHECK-64: jmp qword ptr [rip + fn_ref]
65 else
66 t2:
67 call dword ptr [fn_ref]
68 jmp dword ptr [fn_ref]
69 ; CHECK-32-LABEL: t2:
70 ; CHECK-32: call dword ptr [fn_ref]
71 ; CHECK-32: jmp dword ptr [fn_ref]
73 t3:
74 call fn_ref_word
75 jmp fn_ref_word
76 ; CHECK-32-LABEL: t3:
77 ; CHECK-32: call word ptr [fn_ref_word]
78 ; CHECK-32-NEXT: jmp word ptr [fn_ref_word]
80 t4:
81 call [fn_ref_word]
82 jmp [fn_ref_word]
83 ; CHECK-32-LABEL: t4:
84 ; CHECK-32: call word ptr [fn_ref_word]
85 ; CHECK-32-NEXT: jmp word ptr [fn_ref_word]
87 t5:
88 call word ptr [fn_ref_word]
89 jmp word ptr [fn_ref_word]
90 ; CHECK-32-LABEL: t5:
91 ; CHECK-32: call word ptr [fn_ref_word]
92 ; CHECK-32-NEXT: jmp word ptr [fn_ref_word]
93 endif
95 t6:
96 call t6
97 jmp t6
98 ; CHECK-LABEL: t6:
99 ; CHECK: call t6
100 ; CHECK-NEXT: jmp t6
103 call [t7]
104 jmp [t7]
105 ; CHECK-LABEL: t7:
106 ; CHECK: call t7
107 ; CHECK-NEXT: jmp t7
109 ifdef rax
111 call qword ptr [t8]
112 jmp qword ptr [t8]
113 ; CHECK-64-LABEL: t8:
114 ; CHECK-64: call qword ptr [rip + t8]
115 ; CHECK-64-NEXT: jmp qword ptr [rip + t8]
116 else
118 call dword ptr [t8]
119 jmp dword ptr [t8]
120 ; CHECK-32-LABEL: t8:
121 ; CHECK-32: call dword ptr [t8]
122 ; CHECK-32-NEXT: jmp dword ptr [t8]
123 endif
126 call fn
127 jmp fn
128 ; CHECK-LABEL: t9:
129 ; CHECK: call fn
130 ; CHECK-NEXT: jmp fn
132 t10:
133 call [fn]
134 jmp [fn]
135 ; CHECK-LABEL: t10:
136 ; CHECK: call fn
137 ; CHECK-NEXT: jmp fn
139 ifdef rax
140 t11:
141 call qword ptr [fn]
142 jmp qword ptr [fn]
143 ; CHECK-64-LABEL: t11:
144 ; CHECK-64: call qword ptr [rip + fn]
145 ; CHECK-64-NEXT: jmp qword ptr [rip + fn]
146 else
147 t11:
148 call dword ptr [fn]
149 jmp dword ptr [fn]
150 ; CHECK-32-LABEL: t11:
151 ; CHECK-32: call dword ptr [fn]
152 ; CHECK-32-NEXT: jmp dword ptr [fn]
153 endif
155 t12:
156 call fn_ref_struc
157 jmp fn_ref_struc
158 ; CHECK-LABEL: t12:
159 ; CHECK-64: call qword ptr [rip + fn_ref_struc]
160 ; CHECK-64: jmp qword ptr [rip + fn_ref_struc]
161 ; CHECK-32: call dword ptr [fn_ref_struc]
162 ; CHECK-32: jmp dword ptr [fn_ref_struc]
164 t13:
165 call [fn_ref_struc]
166 jmp [fn_ref_struc]
167 ; CHECK-LABEL: t13:
168 ; CHECK-64: call qword ptr [rip + fn_ref_struc]
169 ; CHECK-64: jmp qword ptr [rip + fn_ref_struc]
170 ; CHECK-32: call dword ptr [fn_ref_struc]
171 ; CHECK-32: jmp dword ptr [fn_ref_struc]
173 ifdef rax
174 t14:
175 call qword ptr [fn_ref_struc]
176 jmp qword ptr [fn_ref_struc]
177 ; CHECK-64-LABEL: t14:
178 ; CHECK-64: call qword ptr [rip + fn_ref_struc]
179 ; CHECK-64: jmp qword ptr [rip + fn_ref_struc]
180 else
181 t14:
182 call dword ptr [fn_ref_struc]
183 jmp dword ptr [fn_ref_struc]
184 ; CHECK-32-LABEL: t14:
185 ; CHECK-32: call dword ptr [fn_ref_struc]
186 ; CHECK-32: jmp dword ptr [fn_ref_struc]
187 endif
189 t15:
190 je t15
191 ; CHECK-LABEL: t15:
192 ; CHECK: je t15
194 t16:
195 je [t16];
196 ; CHECK-LABEL: t16:
197 ; CHECK: je t16
199 t17:
200 call fn_ref_extern
201 jmp fn_ref_extern
202 ; CHECK-LABEL: t17:
203 ; CHECK-64: call qword ptr [rip + fn_ref_extern]
204 ; CHECK-64: jmp qword ptr [rip + fn_ref_extern]
205 ; CHECK-32: call dword ptr [fn_ref_extern]
206 ; CHECK-32: jmp dword ptr [fn_ref_extern]
208 t18:
209 call [fn_ref_extern]
210 jmp [fn_ref_extern]
211 ; CHECK-LABEL: t18:
212 ; CHECK-64: call qword ptr [rip + fn_ref_extern]
213 ; CHECK-64: jmp qword ptr [rip + fn_ref_extern]
214 ; CHECK-32: call dword ptr [fn_ref_extern]
215 ; CHECK-32: jmp dword ptr [fn_ref_extern]
217 ifdef rax
218 t19:
219 call qword ptr [fn_ref_extern]
220 jmp qword ptr [fn_ref_extern]
221 ; CHECK-64-LABEL: t19:
222 ; CHECK-64: call qword ptr [rip + fn_ref_extern]
223 ; CHECK-64: jmp qword ptr [rip + fn_ref_extern]
224 else
225 t19:
226 call dword ptr [fn_ref_extern]
227 jmp dword ptr [fn_ref_extern]
228 ; CHECK-32-LABEL: t19:
229 ; CHECK-32: call dword ptr [fn_ref_extern]
230 ; CHECK-32: jmp dword ptr [fn_ref_extern]
232 t20:
233 call fn_ref_extern_word
234 jmp fn_ref_extern_word
235 ; CHECK-32-LABEL: t20:
236 ; CHECK-32: call word ptr [fn_ref_extern_word]
237 ; CHECK-32-NEXT: jmp word ptr [fn_ref_extern_word]
239 t21:
240 call [fn_ref_extern_word]
241 jmp [fn_ref_extern_word]
242 ; CHECK-32-LABEL: t21:
243 ; CHECK-32: call word ptr [fn_ref_extern_word]
244 ; CHECK-32-NEXT: jmp word ptr [fn_ref_extern_word]
246 t22:
247 call word ptr [fn_ref_extern_word]
248 jmp word ptr [fn_ref_extern_word]
249 ; CHECK-32-LABEL: t22:
250 ; CHECK-32: call word ptr [fn_ref_extern_word]
251 ; CHECK-32-NEXT: jmp word ptr [fn_ref_extern_word]
252 endif
254 t23:
255 call fn_proc_extern
256 jmp fn_proc_extern
257 ; CHECK-LABEL: t23:
258 ; CHECK: call fn_proc_extern
260 t24:
261 call [fn_proc_extern]
262 jmp [fn_proc_extern]
263 ; CHECK-LABEL: t24:
264 ; CHECK: call fn_proc_extern
266 t25:
267 ; CHECK-LABEL: t25:
268 ifdef rax
269 call qword ptr [fn_ref_extern]
270 jmp qword ptr [fn_ref_extern]
271 ; CHECK-64: call qword ptr [rip + fn_ref_extern]
272 ; CHECK-64: jmp qword ptr [rip + fn_ref_extern]
273 else
274 call dword ptr [fn_ref_extern]
275 jmp dword ptr [fn_ref_extern]
276 ; CHECK-32: call dword ptr [fn_ref_extern]
277 ; CHECK-32: jmp dword ptr [fn_ref_extern]
278 endif