1; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s 2 3declare x86_64_win64cc void @win64_callee(i32) 4declare x86_64_win64cc void (i32)* @win64_indirect() 5declare x86_64_win64cc void @win64_other(i32) 6declare void @sysv_callee(i32) 7declare void (i32)* @sysv_indirect() 8declare void @sysv_other(i32) 9 10define void @sysv_caller(i32 %p1) { 11entry: 12 tail call x86_64_win64cc void @win64_callee(i32 %p1) 13 ret void 14} 15 16; CHECK-LABEL: sysv_caller: 17; CHECK: subq $40, %rsp 18; CHECK: callq win64_callee 19; CHECK: addq $40, %rsp 20; CHECK: retq 21 22define x86_64_win64cc void @win64_caller(i32 %p1) { 23entry: 24 tail call void @sysv_callee(i32 %p1) 25 ret void 26} 27 28; CHECK-LABEL: win64_caller: 29; CHECK: callq sysv_callee 30; CHECK: retq 31 32define void @sysv_matched(i32 %p1) { 33 tail call void @sysv_callee(i32 %p1) 34 ret void 35} 36 37; CHECK-LABEL: sysv_matched: 38; CHECK: jmp sysv_callee # TAILCALL 39 40define x86_64_win64cc void @win64_matched(i32 %p1) { 41 tail call x86_64_win64cc void @win64_callee(i32 %p1) 42 ret void 43} 44 45; CHECK-LABEL: win64_matched: 46; CHECK: jmp win64_callee # TAILCALL 47 48define x86_64_win64cc void @win64_indirect_caller(i32 %p1) { 49 %1 = call x86_64_win64cc void (i32)* @win64_indirect() 50 call x86_64_win64cc void @win64_other(i32 0) 51 tail call x86_64_win64cc void %1(i32 %p1) 52 ret void 53} 54 55; CHECK-LABEL: win64_indirect_caller: 56; CHECK: jmpq *%{{rax|rcx|rdx|r8|r9|r11}} # TAILCALL 57 58define void @sysv_indirect_caller(i32 %p1) { 59 %1 = call void (i32)* @sysv_indirect() 60 call void @sysv_other(i32 0) 61 tail call void %1(i32 %p1) 62 ret void 63} 64 65; CHECK-LABEL: sysv_indirect_caller: 66; CHECK: jmpq *%{{rax|rcx|rdx|rsi|rdi|r8|r9|r11}} # TAILCALL 67