2012-10-02 22:26:08 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm < %s | FileCheck %s
|
2008-11-12 04:21:14 +08:00
|
|
|
|
|
|
|
void __attribute__((fastcall)) f1(void);
|
|
|
|
void __attribute__((stdcall)) f2(void);
|
2010-05-19 00:57:00 +08:00
|
|
|
void __attribute__((thiscall)) f3(void);
|
|
|
|
void __attribute__((fastcall)) f4(void) {
|
|
|
|
// CHECK: define x86_fastcallcc void @f4()
|
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
|
|
|
}
|
2010-05-19 00:57:00 +08:00
|
|
|
void __attribute__((stdcall)) f5(void) {
|
|
|
|
// CHECK: define x86_stdcallcc void @f5()
|
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-05-19 00:57:00 +08:00
|
|
|
void __attribute__((thiscall)) f6(void) {
|
|
|
|
// CHECK: define x86_thiscallcc void @f6()
|
|
|
|
f3();
|
|
|
|
// CHECK: call x86_thiscallcc void @f3()
|
|
|
|
}
|
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;
|
2010-05-19 00:57:00 +08:00
|
|
|
void (__attribute__((thiscall)) *pf3)(void) = f3;
|
|
|
|
void (__attribute__((fastcall)) *pf4)(void) = f4;
|
|
|
|
void (__attribute__((stdcall)) *pf5)(void) = f5;
|
|
|
|
void (__attribute__((thiscall)) *pf6)(void) = f6;
|
2010-02-06 02:13:10 +08:00
|
|
|
|
2008-11-12 04:21:14 +08:00
|
|
|
int main(void) {
|
2010-05-19 00:57:00 +08:00
|
|
|
f4(); f5(); f6();
|
|
|
|
// CHECK: call x86_fastcallcc void @f4()
|
|
|
|
// CHECK: call x86_stdcallcc void @f5()
|
|
|
|
// CHECK: call x86_thiscallcc void @f6()
|
|
|
|
pf1(); pf2(); pf3(); pf4(); pf5(); pf6();
|
2010-02-06 05:31:56 +08:00
|
|
|
// CHECK: call x86_fastcallcc void %{{.*}}()
|
|
|
|
// CHECK: call x86_stdcallcc void %{{.*}}()
|
2010-05-19 00:57:00 +08:00
|
|
|
// CHECK: call x86_thiscallcc void %{{.*}}()
|
2010-02-06 05:31:56 +08:00
|
|
|
// CHECK: call x86_fastcallcc void %{{.*}}()
|
|
|
|
// CHECK: call x86_stdcallcc void %{{.*}}()
|
2010-05-19 00:57:00 +08:00
|
|
|
// CHECK: call x86_thiscallcc void %{{.*}}()
|
2008-11-12 04:21:14 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-05-17 10:50:18 +08:00
|
|
|
// PR7117
|
2010-05-19 00:57:00 +08:00
|
|
|
void __attribute((stdcall)) f7(foo) int foo; {}
|
|
|
|
void f8(void) {
|
|
|
|
f7(0);
|
2011-09-21 16:08:30 +08:00
|
|
|
// CHECK: call x86_stdcallcc void @f7(i32 0)
|
2010-05-17 10:50:18 +08:00
|
|
|
}
|