1 ; RUN: llc < %s -mtriple=x86_64-linux -tailcallopt | FileCheck %s
3 ; FIXME: Win64 does not support byval.
5 ; Expect the entry point.
8 ; Expect 2 rep;movs because of tail call byval lowering.
12 ; A sequence of copyto/copyfrom virtual registers is used to deal with byval
13 ; lowering appearing after moving arguments to registers. The following two
14 ; checks verify that the register allocator changes those sequences to direct
15 ; moves to argument register where it can (for registers that are not used in
16 ; byval lowering - not rsi, not rdi, not rcx).
17 ; Expect argument 4 to be moved directly to register edx.
18 ; CHECK: movl $7, %edx
20 ; Expect argument 6 to be moved directly to register r8.
21 ; CHECK: movl $17, %r8d
23 ; Expect not call but jmp to @tailcallee.
24 ; CHECK: jmp tailcallee
27 ; CHECK: .size tailcaller
29 %struct.s = type { i64, i64, i64, i64, i64, i64, i64, i64,
30 i64, i64, i64, i64, i64, i64, i64, i64,
31 i64, i64, i64, i64, i64, i64, i64, i64 }
33 declare fastcc i64 @tailcallee(%struct.s* byval %a, i64 %val, i64 %val2, i64 %val3, i64 %val4, i64 %val5)
36 define fastcc i64 @tailcaller(i64 %b, %struct.s* byval %a) {
38 %tmp2 = getelementptr %struct.s* %a, i32 0, i32 1
39 %tmp3 = load i64* %tmp2, align 8
40 %tmp4 = tail call fastcc i64 @tailcallee(%struct.s* byval %a , i64 %tmp3, i64 %b, i64 7, i64 13, i64 17)