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
5 extern fn_ref_extern
: qword
7 extern fn_ref_extern
: dword
10 extern fn_proc_extern
: proc
11 extern fn_ref_extern_word
: word
24 BranchTargetStruc
struc
29 BranchTargetStruc
ends
33 fn_ref_struc BranchTargetStruc
{3, 3}
35 fn_ref_struc BranchTargetStruc
{3}
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]
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]
60 call qword ptr [fn_ref
]
61 jmp qword ptr [fn_ref
]
63 ; CHECK-64: call qword ptr [rip + fn_ref]
64 ; CHECK-64: jmp qword ptr [rip + fn_ref]
67 call dword ptr [fn_ref
]
68 jmp dword ptr [fn_ref
]
70 ; CHECK-32: call dword ptr [fn_ref]
71 ; CHECK-32: jmp dword ptr [fn_ref]
77 ; CHECK-32: call word ptr [fn_ref_word]
78 ; CHECK-32-NEXT: jmp word ptr [fn_ref_word]
84 ; CHECK-32: call word ptr [fn_ref_word]
85 ; CHECK-32-NEXT: jmp word ptr [fn_ref_word]
88 call word ptr [fn_ref_word
]
89 jmp word ptr [fn_ref_word
]
91 ; CHECK-32: call word ptr [fn_ref_word]
92 ; CHECK-32-NEXT: jmp word ptr [fn_ref_word]
113 ; CHECK-64-LABEL: t8:
114 ; CHECK-64: call qword ptr [rip + t8]
115 ; CHECK-64-NEXT: jmp qword ptr [rip + t8]
120 ; CHECK-32-LABEL: t8:
121 ; CHECK-32: call dword ptr [t8]
122 ; CHECK-32-NEXT: jmp dword ptr [t8]
143 ; CHECK-64-LABEL: t11:
144 ; CHECK-64: call qword ptr [rip + fn]
145 ; CHECK-64-NEXT: jmp qword ptr [rip + fn]
150 ; CHECK-32-LABEL: t11:
151 ; CHECK-32: call dword ptr [fn]
152 ; CHECK-32-NEXT: jmp dword ptr [fn]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
258 ; CHECK: call fn_proc_extern
261 call [fn_proc_extern
]
264 ; CHECK: call fn_proc_extern
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]
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]