blob: b60f8c70d762ddcae068ae5441e1a58a8085de91 [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
17int
18main(void) {
Rafael Espindola366ed482010-03-30 21:19:02 +000019 // CHECK: call void @reduced(i8 signext inreg 0, {{.*}} %struct.anon* inreg null
Mike Stump1eb44332009-09-09 15:08:12 +000020 reduced(0, 0.0, 0, 0.0, 0);
Daniel Dunbar7c760272010-03-30 23:50:00 +000021 // CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2)
Rafael Espindola425ef722010-03-30 22:15:11 +000022 bar(1,2);
Anton Korobeynikov980d60a2009-04-04 00:49:38 +000023}