11; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
22; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s -check-prefix=X64
3+ ; RUN: llc < %s -mtriple=x86_64-windows-msvc | FileCheck %s -check-prefix=UEFI64
4+ ; RUN: llc < %s -mtriple=x86_64-uefi | FileCheck %s -check-prefix=UEFI64
35; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s -check-prefix=X32
46
57; With -tailcallopt, CodeGen guarantees a tail call optimization
@@ -16,6 +18,14 @@ define dso_local tailcc i32 @tailcaller(i32 %in1, i32 %in2) nounwind {
1618; X64-NEXT: popq %rax
1719; X64-NEXT: jmp tailcallee # TAILCALL
1820;
21+ ; UEFI64-LABEL: tailcaller:
22+ ; UEFI64: # %bb.0: # %entry
23+ ; UEFI64-NEXT: subq $40, %rsp
24+ ; UEFI64-NEXT: movl %ecx, %r8d
25+ ; UEFI64-NEXT: movl %edx, %r9d
26+ ; UEFI64-NEXT: addq $40, %rsp
27+ ; UEFI64-NEXT: jmp tailcallee # TAILCALL
28+ ;
1929; X32-LABEL: tailcaller:
2030; X32: # %bb.0: # %entry
2131; X32-NEXT: subl $16, %esp
@@ -39,6 +49,10 @@ define tailcc noalias ptr @noalias_caller() nounwind {
3949; X64-NEXT: popq %rax
4050; X64-NEXT: jmp alias_callee # TAILCALL
4151;
52+ ; UEFI64-LABEL: noalias_caller:
53+ ; UEFI64: # %bb.0:
54+ ; UEFI64-NEXT: jmp alias_callee # TAILCALL
55+ ;
4256; X32-LABEL: noalias_caller:
4357; X32: # %bb.0:
4458; X32-NEXT: jmp alias_callee # TAILCALL
@@ -55,6 +69,10 @@ define dso_local tailcc ptr @alias_caller() nounwind {
5569; X64-NEXT: popq %rax
5670; X64-NEXT: jmp noalias_callee # TAILCALL
5771;
72+ ; UEFI64-LABEL: alias_caller:
73+ ; UEFI64: # %bb.0:
74+ ; UEFI64-NEXT: jmp noalias_callee # TAILCALL
75+ ;
5876; X32-LABEL: alias_caller:
5977; X32: # %bb.0:
6078; X32-NEXT: jmp noalias_callee # TAILCALL
@@ -71,6 +89,10 @@ define dso_local tailcc i32 @ret_undef() nounwind {
7189; X64-NEXT: popq %rax
7290; X64-NEXT: jmp i32_callee # TAILCALL
7391;
92+ ; UEFI64-LABEL: ret_undef:
93+ ; UEFI64: # %bb.0:
94+ ; UEFI64-NEXT: jmp i32_callee # TAILCALL
95+ ;
7496; X32-LABEL: ret_undef:
7597; X32: # %bb.0:
7698; X32-NEXT: jmp i32_callee # TAILCALL
@@ -87,6 +109,10 @@ define dso_local tailcc i32 @noret() nounwind {
87109; X64-NEXT: popq %rax
88110; X64-NEXT: jmp does_not_return # TAILCALL
89111;
112+ ; UEFI64-LABEL: noret:
113+ ; UEFI64: # %bb.0:
114+ ; UEFI64-NEXT: jmp does_not_return # TAILCALL
115+ ;
90116; X32-LABEL: noret:
91117; X32: # %bb.0:
92118; X32-NEXT: jmp does_not_return # TAILCALL
@@ -103,6 +129,16 @@ define dso_local tailcc void @void_test(i32, i32, i32, i32) {
103129; X64-NEXT: .cfi_def_cfa_offset 8
104130; X64-NEXT: jmp void_test # TAILCALL
105131;
132+ ; UEFI64-LABEL: void_test:
133+ ; UEFI64: # %bb.0: # %entry
134+ ; UEFI64-NEXT: subq $40, %rsp
135+ ; UEFI64-NEXT: .seh_stackalloc 40
136+ ; UEFI64-NEXT: .seh_endprologue
137+ ; UEFI64-NEXT: .seh_startepilogue
138+ ; UEFI64-NEXT: addq $40, %rsp
139+ ; UEFI64-NEXT: .seh_endepilogue
140+ ; UEFI64-NEXT: jmp void_test # TAILCALL
141+ ;
106142; X32-LABEL: void_test:
107143; X32: # %bb.0: # %entry
108144; X32-NEXT: pushl %esi
@@ -133,6 +169,16 @@ define dso_local tailcc i1 @i1test(i32, i32, i32, i32) {
133169; X64-NEXT: .cfi_def_cfa_offset 8
134170; X64-NEXT: jmp i1test # TAILCALL
135171;
172+ ; UEFI64-LABEL: i1test:
173+ ; UEFI64: # %bb.0: # %entry
174+ ; UEFI64-NEXT: subq $40, %rsp
175+ ; UEFI64-NEXT: .seh_stackalloc 40
176+ ; UEFI64-NEXT: .seh_endprologue
177+ ; UEFI64-NEXT: .seh_startepilogue
178+ ; UEFI64-NEXT: addq $40, %rsp
179+ ; UEFI64-NEXT: .seh_endepilogue
180+ ; UEFI64-NEXT: jmp i1test # TAILCALL
181+ ;
136182; X32-LABEL: i1test:
137183; X32: # %bb.0: # %entry
138184; X32-NEXT: pushl %esi
0 commit comments