2010-02-06 04:45:48 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
|
2008-11-12 04:21:14 +08:00
|
|
|
|
|
|
|
void __attribute__((fastcall)) f1(void);
|
|
|
|
void __attribute__((stdcall)) f2(void);
|
|
|
|
void __attribute__((fastcall)) f3(void) {
|
2010-02-06 04:45:48 +08:00
|
|
|
// CHECK: define x86_fastcallcc void @f3()
|
2008-11-12 04:21:14 +08:00
|
|
|
f1();
|
2010-02-06 04:45:48 +08:00
|
|
|
// CHECK: call x86_fastcallcc void @f1()
|
2008-11-12 04:21:14 +08:00
|
|
|
}
|
|
|
|
void __attribute__((stdcall)) f4(void) {
|
2010-02-06 04:45:48 +08:00
|
|
|
// CHECK: define x86_stdcallcc void @f4()
|
2008-11-12 04:21:14 +08:00
|
|
|
f2();
|
2010-02-06 04:45:48 +08:00
|
|
|
// CHECK: call x86_stdcallcc void @f2()
|
2008-11-12 04:21:14 +08:00
|
|
|
}
|
|
|
|
|
2010-02-06 02:13:10 +08:00
|
|
|
// PR5280
|
|
|
|
void (__attribute__((fastcall)) *pf1)(void) = f1;
|
|
|
|
void (__attribute__((stdcall)) *pf2)(void) = f2;
|
|
|
|
void (__attribute__((fastcall)) *pf3)(void) = f3;
|
|
|
|
void (__attribute__((stdcall)) *pf4)(void) = f4;
|
|
|
|
|
2008-11-12 04:21:14 +08:00
|
|
|
int main(void) {
|
|
|
|
f3(); f4();
|
2010-02-06 04:45:48 +08:00
|
|
|
// CHECK: call x86_fastcallcc void @f3()
|
|
|
|
// CHECK: call x86_stdcallcc void @f4()
|
2010-02-06 02:13:10 +08:00
|
|
|
pf1(); pf2(); pf3(); pf4();
|
2010-02-06 05:31:56 +08:00
|
|
|
// CHECK: call x86_fastcallcc void %{{.*}}()
|
|
|
|
// CHECK: call x86_stdcallcc void %{{.*}}()
|
|
|
|
// CHECK: call x86_fastcallcc void %{{.*}}()
|
|
|
|
// CHECK: call x86_stdcallcc void %{{.*}}()
|
2008-11-12 04:21:14 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|