freebsd-nq/test/CodeGen/regparm.c

28 lines
720 B
C
Raw Normal View History

2010-04-02 08:55:10 +00:00
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
2009-06-02 17:58:47 +00:00
#define FASTCALL __attribute__((regparm(2)))
typedef struct {
int aaa;
double bbbb;
int ccc[200];
} foo;
2010-04-02 08:55:10 +00:00
typedef void (*FType)(int, int) __attribute ((regparm (3), stdcall));
FType bar;
extern void FASTCALL reduced(char b, double c, foo* d, double e, int f);
2009-06-02 17:58:47 +00:00
2010-07-13 17:21:42 +00:00
// PR7025
void FASTCALL f1(int i, int j, int k);
// CHECK-LABEL: define void @f1(i32 inreg %i, i32 inreg %j, i32 %k)
2010-07-13 17:21:42 +00:00
void f1(int i, int j, int k) { }
2009-06-02 17:58:47 +00:00
int
main(void) {
// CHECK: call void @reduced(i8 inreg signext 0, {{.*}} %struct.foo* inreg null
2009-10-14 18:03:49 +00:00
reduced(0, 0.0, 0, 0.0, 0);
2010-04-02 08:55:10 +00:00
// CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2)
bar(1,2);
2009-06-02 17:58:47 +00:00
}