diff options
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-ms.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/mangle-ms.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle-ms.cpp b/clang/test/CodeGenCXX/mangle-ms.cpp index 6787b6bd34f..a528054d8d0 100644 --- a/clang/test/CodeGenCXX/mangle-ms.cpp +++ b/clang/test/CodeGenCXX/mangle-ms.cpp @@ -6,6 +6,7 @@ // CHECK: @"\01?d@foo@@0FB" // CHECK: @"\01?e@foo@@1JC" // CHECK: @"\01?f@foo@@2DD" +// CHECK: @"\01?g@bar@@2HA" int a; @@ -24,6 +25,22 @@ public: int operator+(int a); }; +struct bar { + static int g; +}; + +union baz { + int a; + char b; + double c; +}; + +enum quux { + qone, + qtwo, + qthree +}; + int foo::operator+(int a) {return a;} // CHECK: @"\01??Hfoo@@QAAHH@Z" @@ -31,6 +48,8 @@ const short foo::d = 0; volatile long foo::e; const volatile char foo::f = 'C'; +int bar::g; + // Static functions are mangled, too. // Also make sure calling conventions, arglists, and throw specs work. static void __stdcall alpha(float a, double b) throw() {} @@ -42,3 +61,7 @@ bool __fastcall beta(long long a, wchar_t b) throw(signed char, unsigned char) { // CHECK: @"\01?alpha@@YGXMN@@" +// Make sure tag-type mangling works. +void gamma(class foo, struct bar, union baz, enum quux) {} +// CHECK: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z" + |