blob: 151c58f958bd085f4d52324827a6e3c382e76741 [file] [log] [blame]
Rafael Espindolac50c27c2010-03-30 20:24:48 +00001// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
Anton Korobeynikov18e831d2009-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 Espindola49b85ab2010-03-30 22:15:11 +000011typedef void (*FType)(int, int) __attribute ((regparm (3), stdcall));
12FType bar;
13
John McCall83779672011-02-19 02:53:41 +000014extern void FASTCALL reduced(char b, double c, foo* d, double e, int f);
Anton Korobeynikov18e831d2009-04-04 00:49:38 +000015
Douglas Gregor77e274f2010-06-18 21:30:25 +000016// PR7025
17void FASTCALL f1(int i, int j, int k);
Stephen Lin43622612013-08-15 06:47:53 +000018// CHECK-LABEL: define void @f1(i32 inreg %i, i32 inreg %j, i32 %k)
Douglas Gregor77e274f2010-06-18 21:30:25 +000019void f1(int i, int j, int k) { }
20
Anton Korobeynikov18e831d2009-04-04 00:49:38 +000021int
22main(void) {
Bill Wendling85ab57a2013-01-31 23:17:12 +000023 // CHECK: call void @reduced(i8 inreg signext 0, {{.*}} %struct.foo* inreg null
Mike Stump11289f42009-09-09 15:08:12 +000024 reduced(0, 0.0, 0, 0.0, 0);
Daniel Dunbarc4d551b2010-03-30 23:50:00 +000025 // CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2)
Rafael Espindola49b85ab2010-03-30 22:15:11 +000026 bar(1,2);
Anton Korobeynikov18e831d2009-04-04 00:49:38 +000027}