blob: a96e5043fed4eecc79a21dcd2f5f7240eccccd7f [file] [log] [blame]
Anton Korobeynikovded05e32010-05-16 09:08:45 +00001; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | FileCheck %s
Chris Lattnerb7941072005-05-12 23:09:04 +00002; check that fastcc is passing stuff in regs.
3
Chris Lattner7e085702007-02-28 18:35:36 +00004declare x86_fastcallcc i64 @callee(i64)
Chris Lattner120e07f2006-03-18 23:48:54 +00005
Chris Lattner7e085702007-02-28 18:35:36 +00006define i64 @caller() {
Chris Lattneref6c8752007-11-18 18:26:45 +00007 %X = call x86_fastcallcc i64 @callee( i64 4294967299 ) ; <i64> [#uses=1]
Anton Korobeynikovded05e32010-05-16 09:08:45 +00008; CHECK: mov{{.*}}EDX, 1
Chris Lattner7e085702007-02-28 18:35:36 +00009 ret i64 %X
Chris Lattnerb7941072005-05-12 23:09:04 +000010}
11
Chris Lattner7e085702007-02-28 18:35:36 +000012define x86_fastcallcc i64 @caller2(i64 %X) {
13 ret i64 %X
Anton Korobeynikovded05e32010-05-16 09:08:45 +000014; CHECK: mov{{.*}}EAX, ECX
15}
16
17declare x86_thiscallcc i64 @callee2(i32)
18
19define i64 @caller3() {
20 %X = call x86_thiscallcc i64 @callee2( i32 3 )
21; CHECK: mov{{.*}}ECX, 3
22 ret i64 %X
23}
24
25define x86_thiscallcc i32 @caller4(i32 %X) {
26 ret i32 %X
27; CHECK: mov{{.*}}EAX, ECX
Chris Lattnerb7941072005-05-12 23:09:04 +000028}
Chris Lattner7e085702007-02-28 18:35:36 +000029