blob: a96e5043fed4eecc79a21dcd2f5f7240eccccd7f [file] [log] [blame]
Anton Korobeynikov8f35fab2010-05-16 09:08:45 +00001; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | FileCheck %s
Chris Lattner53eadd12005-05-12 23:09:04 +00002; check that fastcc is passing stuff in regs.
3
Chris Lattnercbb54512007-02-28 18:35:36 +00004declare x86_fastcallcc i64 @callee(i64)
Chris Lattner544dab32006-03-18 23:48:54 +00005
Chris Lattnercbb54512007-02-28 18:35:36 +00006define i64 @caller() {
Chris Lattner861302e2007-11-18 18:26:45 +00007 %X = call x86_fastcallcc i64 @callee( i64 4294967299 ) ; <i64> [#uses=1]
Anton Korobeynikov8f35fab2010-05-16 09:08:45 +00008; CHECK: mov{{.*}}EDX, 1
Chris Lattnercbb54512007-02-28 18:35:36 +00009 ret i64 %X
Chris Lattner53eadd12005-05-12 23:09:04 +000010}
11
Chris Lattnercbb54512007-02-28 18:35:36 +000012define x86_fastcallcc i64 @caller2(i64 %X) {
13 ret i64 %X
Anton Korobeynikov8f35fab2010-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 Lattner53eadd12005-05-12 23:09:04 +000028}
Chris Lattnercbb54512007-02-28 18:35:36 +000029