blob: 95f5fa3f83b599cff17eba4cf53befb9d6d37296 [file] [log] [blame]
Douglas Gregord1808f32010-05-18 17:43:51 +00001// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
2
3void __fastcall f1(void);
4void __stdcall f2(void);
5void __thiscall f3(void);
6void __fastcall f4(void) {
7// CHECK: define x86_fastcallcc void @f4()
8 f1();
9// CHECK: call x86_fastcallcc void @f1()
10}
11void __stdcall f5(void) {
12// CHECK: define x86_stdcallcc void @f5()
13 f2();
14// CHECK: call x86_stdcallcc void @f2()
15}
16void __thiscall f6(void) {
17// CHECK: define x86_thiscallcc void @f6()
18 f3();
19// CHECK: call x86_thiscallcc void @f3()
20}
21
22// PR5280
23void (__fastcall *pf1)(void) = f1;
24void (__stdcall *pf2)(void) = f2;
25void (__thiscall *pf3)(void) = f3;
26void (__fastcall *pf4)(void) = f4;
27void (__stdcall *pf5)(void) = f5;
28void (__thiscall *pf6)(void) = f6;
29
30int main(void) {
31 f4(); f5(); f6();
32 // CHECK: call x86_fastcallcc void @f4()
33 // CHECK: call x86_stdcallcc void @f5()
34 // CHECK: call x86_thiscallcc void @f6()
35 pf1(); pf2(); pf3(); pf4(); pf5(); pf6();
36 // CHECK: call x86_fastcallcc void %{{.*}}()
37 // CHECK: call x86_stdcallcc void %{{.*}}()
38 // CHECK: call x86_thiscallcc void %{{.*}}()
39 // CHECK: call x86_fastcallcc void %{{.*}}()
40 // CHECK: call x86_stdcallcc void %{{.*}}()
41 // CHECK: call x86_thiscallcc void %{{.*}}()
42 return 0;
43}
44
45// PR7117
46void __stdcall f7(foo) int foo; {}
47void f8(void) {
48 f7(0);
49 // CHECK: call x86_stdcallcc void (...)* bitcast
50}