[AVX512] adding PROLQ and PROLD Intrinsics
[oota-llvm.git] / test / CodeGen / X86 / musttail-thiscall.ll
1 ; RUN: llc -march=x86 < %s | FileCheck %s
2 ; RUN: llc -march=x86 -O0 < %s | FileCheck %s
3
4 ; CHECK-LABEL: t1:
5 ; CHECK: jmp {{_?}}t1_callee
6 define x86_thiscallcc void @t1(i8* %this) {
7   %adj = getelementptr i8, i8* %this, i32 4
8   musttail call x86_thiscallcc void @t1_callee(i8* %adj)
9   ret void
10 }
11 declare x86_thiscallcc void @t1_callee(i8* %this)
12
13 ; CHECK-LABEL: t2:
14 ; CHECK: jmp {{_?}}t2_callee
15 define x86_thiscallcc i32 @t2(i8* %this, i32 %a) {
16   %adj = getelementptr i8, i8* %this, i32 4
17   %rv = musttail call x86_thiscallcc i32 @t2_callee(i8* %adj, i32 %a)
18   ret i32 %rv
19 }
20 declare x86_thiscallcc i32 @t2_callee(i8* %this, i32 %a)
21
22 ; CHECK-LABEL: t3:
23 ; CHECK: jmp {{_?}}t3_callee
24 define x86_thiscallcc i8* @t3(i8* %this, <{ i8*, i32 }>* inalloca %args) {
25   %adj = getelementptr i8, i8* %this, i32 4
26   %a_ptr = getelementptr <{ i8*, i32 }>, <{ i8*, i32 }>* %args, i32 0, i32 1
27   store i32 0, i32* %a_ptr
28   %rv = musttail call x86_thiscallcc i8* @t3_callee(i8* %adj, <{ i8*, i32 }>* inalloca %args)
29   ret i8* %rv
30 }
31 declare x86_thiscallcc i8* @t3_callee(i8* %this, <{ i8*, i32 }>* inalloca %args);