1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s -check-prefix=X64
3 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s -check-prefix=X32
5 ; tailcc will turn all of these musttail calls into tail calls.
7 declare dso_local tailcc i32 @tailcallee(i32 %a1, i32 %a2)
9 define dso_local tailcc i32 @tailcaller(i32 %in1, i32 %in2) nounwind {
10 ; X64-LABEL: tailcaller:
11 ; X64: # %bb.0: # %entry
12 ; X64-NEXT: jmp tailcallee # TAILCALL
14 ; X32-LABEL: tailcaller:
15 ; X32: # %bb.0: # %entry
16 ; X32-NEXT: jmp tailcallee # TAILCALL
18 %tmp11 = musttail call tailcc i32 @tailcallee(i32 %in1, i32 %in2)
22 declare dso_local tailcc ptr @alias_callee()
24 define tailcc noalias ptr @noalias_caller() nounwind {
25 ; X64-LABEL: noalias_caller:
27 ; X64-NEXT: jmp alias_callee # TAILCALL
29 ; X32-LABEL: noalias_caller:
31 ; X32-NEXT: jmp alias_callee # TAILCALL
32 %p = musttail call tailcc ptr @alias_callee()
36 declare dso_local tailcc noalias ptr @noalias_callee()
38 define dso_local tailcc ptr @alias_caller() nounwind {
39 ; X64-LABEL: alias_caller:
41 ; X64-NEXT: jmp noalias_callee # TAILCALL
43 ; X32-LABEL: alias_caller:
45 ; X32-NEXT: jmp noalias_callee # TAILCALL
46 %p = musttail call tailcc noalias ptr @noalias_callee()
50 define dso_local tailcc void @void_test(i32, i32, i32, i32) {
51 ; X64-LABEL: void_test:
52 ; X64: # %bb.0: # %entry
53 ; X64-NEXT: jmp void_test # TAILCALL
55 ; X32-LABEL: void_test:
56 ; X32: # %bb.0: # %entry
57 ; X32-NEXT: pushl %esi
58 ; X32-NEXT: .cfi_def_cfa_offset 8
59 ; X32-NEXT: .cfi_offset %esi, -8
60 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
61 ; X32-NEXT: movl {{[0-9]+}}(%esp), %esi
62 ; X32-NEXT: movl %esi, {{[0-9]+}}(%esp)
63 ; X32-NEXT: movl %eax, {{[0-9]+}}(%esp)
65 ; X32-NEXT: .cfi_def_cfa_offset 4
66 ; X32-NEXT: jmp void_test # TAILCALL
68 musttail call tailcc void @void_test( i32 %0, i32 %1, i32 %2, i32 %3)
72 define dso_local tailcc i1 @i1test(i32, i32, i32, i32) {
74 ; X64: # %bb.0: # %entry
75 ; X64-NEXT: jmp i1test # TAILCALL
78 ; X32: # %bb.0: # %entry
79 ; X32-NEXT: pushl %esi
80 ; X32-NEXT: .cfi_def_cfa_offset 8
81 ; X32-NEXT: .cfi_offset %esi, -8
82 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
83 ; X32-NEXT: movl {{[0-9]+}}(%esp), %esi
84 ; X32-NEXT: movl %esi, {{[0-9]+}}(%esp)
85 ; X32-NEXT: movl %eax, {{[0-9]+}}(%esp)
87 ; X32-NEXT: .cfi_def_cfa_offset 4
88 ; X32-NEXT: jmp i1test # TAILCALL
90 %4 = musttail call tailcc i1 @i1test( i32 %0, i32 %1, i32 %2, i32 %3)