aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle-ms.cpp
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2010-06-18 07:51:00 +0000
committerCharles Davis <cdavis@mines.edu>2010-06-18 07:51:00 +0000
commitc62458f6aead5e4c0d0f4534d52142e7864ba02b (patch)
treee043e4890473257bb7f88ea9c694b66ee9cef903 /test/CodeGenCXX/mangle-ms.cpp
parent4c6021995032a898fb0502d5d1fd2df37638e57b (diff)
Mangle tag types (unions, structs, classes, enums) in the Microsoft C++ Mangler.
Also, test that static members with default visibility in a struct have the right mangling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-ms.cpp')
-rw-r--r--test/CodeGenCXX/mangle-ms.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-ms.cpp b/test/CodeGenCXX/mangle-ms.cpp
index 6787b6bd34..a528054d8d 100644
--- a/test/CodeGenCXX/mangle-ms.cpp
+++ b/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"
+