xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/fast-cc-pass-in-regs.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; check that fastcc is passing stuff in regs.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdeclare x86_fastcallcc i64 @callee(i64 inreg)
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i64 @caller() {
7*9880d681SAndroid Build Coastguard Worker        %X = call x86_fastcallcc  i64 @callee( i64 4294967299 )          ; <i64> [#uses=1]
8*9880d681SAndroid Build Coastguard Worker; CHECK: mov{{.*}}edx, 1
9*9880d681SAndroid Build Coastguard Worker        ret i64 %X
10*9880d681SAndroid Build Coastguard Worker}
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Workerdefine x86_fastcallcc i64 @caller2(i64 inreg %X) {
13*9880d681SAndroid Build Coastguard Worker        ret i64 %X
14*9880d681SAndroid Build Coastguard Worker; CHECK: mov{{.*}}eax, ecx
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerdeclare x86_thiscallcc i64 @callee2(i32)
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerdefine i64 @caller3() {
20*9880d681SAndroid Build Coastguard Worker        %X = call x86_thiscallcc i64 @callee2( i32 3 )
21*9880d681SAndroid Build Coastguard Worker; CHECK: mov{{.*}}ecx, 3
22*9880d681SAndroid Build Coastguard Worker        ret i64 %X
23*9880d681SAndroid Build Coastguard Worker}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Workerdefine x86_thiscallcc i32 @caller4(i32 %X) {
26*9880d681SAndroid Build Coastguard Worker        ret i32 %X
27*9880d681SAndroid Build Coastguard Worker; CHECK: mov{{.*}}eax, ecx
28*9880d681SAndroid Build Coastguard Worker}
29*9880d681SAndroid Build Coastguard Worker
30