1 ; RUN: llc -mtriple=x86_64-windows -show-mc-encoding < %s | FileCheck %s
3 ; The Win64 ABI wants tail jmps to use a REX_W prefix so it can distinguish
4 ; in-function jumps from function exiting jumps.
6 define void @tail_jmp_reg(i32, i32, ptr %fptr) {
7 tail call void () %fptr()
11 ; Check that we merge the REX prefixes into 0x49 instead of 0x48, 0x41.
13 ; CHECK-LABEL: tail_jmp_reg:
14 ; CHECK: rex64 jmpq *%r8
15 ; CHECK: encoding: [0x49,0xff,0xe0]
17 declare void @tail_tgt()
19 define void @tail_jmp_imm() {
20 tail call void @tail_tgt()
24 ; CHECK-LABEL: tail_jmp_imm:
27 @g_fptr = global ptr @tail_tgt
29 define void @tail_jmp_mem() {
30 %fptr = load ptr, ptr @g_fptr
31 tail call void () %fptr()
35 ; CHECK-LABEL: tail_jmp_mem:
36 ; CHECK: rex64 jmpq *g_fptr(%rip)