blob: d628b685f94a0b31c018e94a6b68aeca7c753834 [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
John McCall15e310a2011-02-19 02:53:41 +000014extern void FASTCALL reduced(char b, double c, foo* d, double e, int f);
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000015
Douglas Gregord2c64902010-06-18 21:30:25 +000016// PR7025
17void FASTCALL f1(int i, int j, int k);
18// CHECK: define void @f1(i32 inreg %i, i32 inreg %j, i32 %k)
19void f1(int i, int j, int k) { }
20
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000021int
22main(void) {
Chris Lattnercd87d1e2011-07-12 05:53:08 +000023 // CHECK: call void @reduced(i8 signext inreg 0, {{.*}} %struct.foo* inreg null
Mike Stump1eb44332009-09-09 15:08:12 +000024 reduced(0, 0.0, 0, 0.0, 0);
Daniel Dunbar7c760272010-03-30 23:50:00 +000025 // CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2)
Rafael Espindola425ef722010-03-30 22:15:11 +000026 bar(1,2);
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000027}