1 // RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
3 // CHECK: @"\01?a@@3HA"
4 // CHECK: @"\01?b@N@@3HA"
6 // CHECK: @"\01?d@foo@@0FB"
7 // CHECK: @"\01?e@foo@@1JC"
8 // CHECK: @"\01?f@foo@@2DD"
9 // CHECK: @"\01?g@bar@@2HA"
10 // CHECK: @"\01?h@@3QAHA"
11 // CHECK: @"\01?i@@3PAY0BE@HA"
12 // CHECK: @"\01?j@@3P6GHCE@ZA"
13 // CHECK: @"\01?k@@3PTfoo@@DA"
14 // CHECK: @"\01?l@@3P8foo@@AEHH@ZA"
18 namespace N { int b; }
21 int _c(void) {return c;}
22 // CHECK: @"\01?_c@@YAHXZ"
27 static volatile long e;
29 static const volatile char f;
49 int foo::operator+(int a) {return a;}
50 // CHECK: @"\01??Hfoo@@QAEHH@Z"
52 const short foo::d = 0;
54 const volatile char foo::f = 'C';
58 extern int * const h = &a;
62 int (__stdcall *j)(signed char, unsigned char);
64 const volatile char foo::*k;
68 // Static functions are mangled, too.
69 // Also make sure calling conventions, arglists, and throw specs work.
70 static void __stdcall alpha(float a, double b) throw() {}
71 bool __fastcall beta(long long a, wchar_t b) throw(signed char, unsigned char) {
72 // CHECK: @"\01?beta@@YI_N_J_W@Z"
77 // CHECK: @"\01?alpha@@YGXMN@Z"
79 // Make sure tag-type mangling works.
80 void gamma(class foo, struct bar, union baz, enum quux) {}
81 // CHECK: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z"
83 // Make sure pointer/reference-type mangling works.
84 void delta(int * const a, const long &) {}
85 // CHECK: @"\01?delta@@YAXQAHABJ@Z"
88 void epsilon(int a[][10][20]) {}
89 // CHECK: @"\01?epsilon@@YAXQAY19BE@H@Z"
91 // Blocks mangling (Clang extension).
92 void zeta(int (^)(int, int)) {}
93 // CHECK: @"\01?zeta@@YAXP_EAHHH@Z@Z"