aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle-ms-abi-examples.cpp
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2012-06-13 00:18:14 +0000
committerCharles Davis <cdavis@mines.edu>2012-06-13 00:18:14 +0000
commite0deb035b3e2d07b41ea55db84b110abcb65b753 (patch)
tree49080a73b9936b6fa8159b139bcebe03456769d5 /test/CodeGenCXX/mangle-ms-abi-examples.cpp
parentb3b26bfe61558232ccd0053697a143a30ac1e079 (diff)
Grab bag of Microsoft Mangler fixes:
- Support mangling virtual function tables (base tables need work on the ManglerContext interface). - Correct mangling of local scopes (i.e. functions and C++ methods). - Replace every llvm_unreachable() for actually-reachable code with a diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158376 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-ms-abi-examples.cpp')
-rw-r--r--test/CodeGenCXX/mangle-ms-abi-examples.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-ms-abi-examples.cpp b/test/CodeGenCXX/mangle-ms-abi-examples.cpp
new file mode 100644
index 0000000000..d6726cab0d
--- /dev/null
+++ b/test/CodeGenCXX/mangle-ms-abi-examples.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -fms-extensions -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+
+// CHECK: @"\01??_7D@C@?1??foo@@YAXXZ@6B@" =
+// CHECK: @"\01??_7B@?1??foo@A@@QAEXH@Z@6B@" =
+// CHECK: define {{.*}} @"\01?baz@E@?3??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"(
+
+// Microsoft Visual C++ ABI examples.
+struct A {
+ void foo (int) {
+ struct B { virtual ~B() {} };
+ B();
+ }
+};
+void foo () {
+ struct C {
+ struct D { virtual ~D() {} };
+ void bar () {
+ struct E {
+ void baz() { }
+ };
+ E().baz();
+ }
+ };
+ A().foo(0);
+ C::D();
+ C().bar();
+}
+