Merging r261039:
[oota-llvm.git] / test / CodeGen / X86 / win64_sibcall.ll
1 ; RUN: llc < %s -mtriple=x86_64-pc-win32-coreclr | FileCheck %s -check-prefix=WIN_X64
2 ; RUN: llc < %s -mtriple=x86_64-pc-linux         | FileCheck %s -check-prefix=LINUX
3
4 %Object = type <{ [0 x i64*]* }>
5
6 define void @C1(%Object addrspace(1)* %param0) gc "coreclr" {
7 entry:
8
9 ; WIN_X64: # BB#0:
10 ; WIN_X64:      pushq   %rax
11 ; LINUX:   # BB#0:                                 # %entry
12 ; LINUX:        movq    $0, -8(%rsp)
13
14   %this = alloca %Object addrspace(1)*
15   store %Object addrspace(1)* null, %Object addrspace(1)** %this
16   store %Object addrspace(1)* %param0, %Object addrspace(1)** %this
17   br label %0
18
19 ; <label>:0                                       ; preds = %entry
20   %1 = load %Object addrspace(1)*, %Object addrspace(1)** %this, align 8
21
22 ; WIN_X64:      xorl    %r8d, %r8d
23 ; WIN_X64:      popq    %rax
24 ; WIN_X64:      rex64 jmp       C2              # TAILCALL
25 ; LINUX:        xorl    %edx, %edx
26 ; LINUX:        jmp     C2                      # TAILCALL
27
28   tail call void @C2(%Object addrspace(1)* %1, i32 0, %Object addrspace(1)* null)
29   ret void
30 }
31
32 declare void @C2(%Object addrspace(1)*, i32, %Object addrspace(1)*)
33
34 ; Function Attrs: nounwind
35 declare void @llvm.localescape(...) #0
36
37 attributes #0 = { nounwind }
38