summaryrefslogtreecommitdiffstats
path: root/clang/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
commit108f5a274848a7e8ed375c10fc55c85d7398e1f3 (patch)
tree455105d360f7e5f33ae7d18a0514326ac9c790ac /clang/test/CodeGenCXX/mangle-ms.cpp
parent6e4ea2db7fbd1686a2691b24b985b8320f0d2231 (diff)
downloadbcm5719-llvm-108f5a274848a7e8ed375c10fc55c85d7398e1f3.tar.gz
bcm5719-llvm-108f5a274848a7e8ed375c10fc55c85d7398e1f3.zip
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. llvm-svn: 106276
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-ms.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle-ms.cpp23
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"
+
OpenPOWER on IntegriCloud