blob: ec5cbab16a5b57a55eef38caa5c2adeeeaf02f50 [file] [log] [blame]
Rafael Espindola264ba482010-03-30 20:24:48 +00001// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
Anton Korobeynikov980d60a2009-04-04 00:49:38 +00002
3#define FASTCALL __attribute__((regparm(2)))
4
5typedef struct {
6 int aaa;
7 double bbbb;
8 int ccc[200];
9} foo;
10
Rafael Espindola425ef722010-03-30 22:15:11 +000011typedef void (*FType)(int, int) __attribute ((regparm (3), stdcall));
12FType bar;
13
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000014static void FASTCALL
Rafael Espindola425ef722010-03-30 22:15:11 +000015reduced(char b, double c, foo* d, double e, int f);
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000016
Douglas Gregord2c64902010-06-18 21:30:25 +000017// PR7025
18void FASTCALL f1(int i, int j, int k);
19// CHECK: define void @f1(i32 inreg %i, i32 inreg %j, i32 %k)
20void f1(int i, int j, int k) { }
21
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000022int
23main(void) {
Rafael Espindola366ed482010-03-30 21:19:02 +000024 // CHECK: call void @reduced(i8 signext inreg 0, {{.*}} %struct.anon* inreg null
Mike Stump1eb44332009-09-09 15:08:12 +000025 reduced(0, 0.0, 0, 0.0, 0);
Daniel Dunbar7c760272010-03-30 23:50:00 +000026 // CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2)
Rafael Espindola425ef722010-03-30 22:15:11 +000027 bar(1,2);
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000028}