94 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s -check-prefix=X643; RUN: llc < %s -mtriple=x86_64-uefi | FileCheck %s -check-prefix=X644; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s -check-prefix=X865 6; tailcc will turn all of these musttail calls into tail calls.7 8declare dso_local tailcc i32 @tailcallee(i32 %a1, i32 %a2)9 10define dso_local tailcc i32 @tailcaller(i32 %in1, i32 %in2) nounwind {11; X64-LABEL: tailcaller:12; X64: # %bb.0: # %entry13; X64-NEXT: jmp tailcallee # TAILCALL14;15; X86-LABEL: tailcaller:16; X86: # %bb.0: # %entry17; X86-NEXT: jmp tailcallee # TAILCALL18entry:19 %tmp11 = musttail call tailcc i32 @tailcallee(i32 %in1, i32 %in2)20 ret i32 %tmp1121}22 23declare dso_local tailcc ptr @alias_callee()24 25define tailcc noalias ptr @noalias_caller() nounwind {26; X64-LABEL: noalias_caller:27; X64: # %bb.0:28; X64-NEXT: jmp alias_callee # TAILCALL29;30; X86-LABEL: noalias_caller:31; X86: # %bb.0:32; X86-NEXT: jmp alias_callee # TAILCALL33 %p = musttail call tailcc ptr @alias_callee()34 ret ptr %p35}36 37declare dso_local tailcc noalias ptr @noalias_callee()38 39define dso_local tailcc ptr @alias_caller() nounwind {40; X64-LABEL: alias_caller:41; X64: # %bb.0:42; X64-NEXT: jmp noalias_callee # TAILCALL43;44; X86-LABEL: alias_caller:45; X86: # %bb.0:46; X86-NEXT: jmp noalias_callee # TAILCALL47 %p = musttail call tailcc noalias ptr @noalias_callee()48 ret ptr %p49}50 51define dso_local tailcc void @void_test(i32, i32, i32, i32) {52; X64-LABEL: void_test:53; X64: # %bb.0: # %entry54; X64-NEXT: jmp void_test # TAILCALL55;56; X86-LABEL: void_test:57; X86: # %bb.0: # %entry58; X86-NEXT: pushl %esi59; X86-NEXT: .cfi_def_cfa_offset 860; X86-NEXT: .cfi_offset %esi, -861; X86-NEXT: movl {{[0-9]+}}(%esp), %eax62; X86-NEXT: movl {{[0-9]+}}(%esp), %esi63; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)64; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)65; X86-NEXT: popl %esi66; X86-NEXT: .cfi_def_cfa_offset 467; X86-NEXT: jmp void_test # TAILCALL68 entry:69 musttail call tailcc void @void_test( i32 %0, i32 %1, i32 %2, i32 %3)70 ret void71}72 73define dso_local tailcc i1 @i1test(i32, i32, i32, i32) {74; X64-LABEL: i1test:75; X64: # %bb.0: # %entry76; X64-NEXT: jmp i1test # TAILCALL77;78; X86-LABEL: i1test:79; X86: # %bb.0: # %entry80; X86-NEXT: pushl %esi81; X86-NEXT: .cfi_def_cfa_offset 882; X86-NEXT: .cfi_offset %esi, -883; X86-NEXT: movl {{[0-9]+}}(%esp), %eax84; X86-NEXT: movl {{[0-9]+}}(%esp), %esi85; X86-NEXT: movl %esi, {{[0-9]+}}(%esp)86; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)87; X86-NEXT: popl %esi88; X86-NEXT: .cfi_def_cfa_offset 489; X86-NEXT: jmp i1test # TAILCALL90 entry:91 %4 = musttail call tailcc i1 @i1test( i32 %0, i32 %1, i32 %2, i32 %3)92 ret i1 %493}94