1 // Build with "cl.exe /Zi /GR- /GS- -EHs-c- every-function.cpp /link /debug /nodefaultlib /incremental:no /entry:main"
2 // Getting functions with the correct calling conventions requires building in x86.
7 void __cdecl
operator delete(void *,unsigned int) {}
8 void __cdecl
operator delete(void *,unsigned __int64
) {}
10 // All calling conventions that appear in normal code.
11 int __cdecl
cc_cdecl() { return 42; }
12 int __stdcall
cc_stdcall() { return 42; }
13 int __fastcall
cc_fastcall() { return 42; }
14 int __vectorcall
cc_vectorcall() { return 42; }
18 Struct() {} // constructor
20 int __thiscall
cc_thiscall() { return 42; }
24 void VM() volatile { }
25 void CVM() const volatile { }
28 int builtin_one_param(int x
) { return 42; }
29 int builtin_two_params(int x
, char y
) { return 42; }
31 void struct_one_param(Struct S
) { }
33 void modified_builtin_param(const int X
) { }
34 void modified_struct_param(const Struct S
) { }
36 void pointer_builtin_param(int *X
) { }
37 void pointer_struct_param(Struct
*S
) { }
40 void modified_pointer_builtin_param(const int *X
) { }
41 void modified_pointer_struct_param(const Struct
*S
) { }
43 Struct
rvo() { return Struct(); }
49 struct Base2
: public virtual Base1
{ };
51 struct Derived
: public virtual Base1
, public Base2
{
59 Struct().cc_thiscall();
62 builtin_one_param(42);
63 builtin_two_params(42, 'x');
64 struct_one_param(Struct
{});
66 modified_builtin_param(42);
67 modified_struct_param(Struct());
69 pointer_builtin_param(nullptr);
70 pointer_struct_param(nullptr);
73 modified_pointer_builtin_param(nullptr);
74 modified_pointer_struct_param(nullptr);