summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-02-05 18:59:38 +0000
committerReid Kleckner <reid@kleckner.net>2014-02-05 18:59:38 +0000
commit09b47d166b5355312a358a3fdb1c9850e8c5898d (patch)
tree889a6bcf9b26cef68257c660dd2a7048e8758932 /clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
parent21a6617c34c4c15183b5edf4d7df910395aad0b4 (diff)
downloadbcm5719-llvm-09b47d166b5355312a358a3fdb1c9850e8c5898d.tar.gz
bcm5719-llvm-09b47d166b5355312a358a3fdb1c9850e8c5898d.zip
MS ABI: Fix mangling of static methods and function references
Function references always use $1? like function pointers and never $E? like var decl references. Static methods are mangled like function pointers. llvm-svn: 200869
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-ms-template-callback.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle-ms-template-callback.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp b/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
index cfa4e880a5e..1a8f82fc825 100644
--- a/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
@@ -70,3 +70,20 @@ void call_bar() {
// CHECK: "\01??$bar@P_EAHH@Z@@YAXP_EAHH@Z@Z"
// FYI blocks are not present in MSVS, so we're free to choose the spec.
}
+
+template <void (*Fn)()> void WrapFnPtr() { Fn(); }
+template <void (&Fn)()> void WrapFnRef() { Fn(); }
+struct Thing {
+ static void VoidStaticMethod();
+};
+void VoidFn();
+void CallWrapper() {
+ WrapFnPtr<VoidFn>();
+ WrapFnRef<VoidFn>();
+ WrapFnPtr<Thing::VoidStaticMethod>();
+ WrapFnRef<Thing::VoidStaticMethod>();
+}
+// CHECK: call {{.*}} @"\01??$WrapFnPtr@$1?VoidFn@@YAXXZ@@YAXXZ"
+// CHECK: call {{.*}} @"\01??$WrapFnRef@$1?VoidFn@@YAXXZ@@YAXXZ"
+// CHECK: call {{.*}} @"\01??$WrapFnPtr@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ"
+// CHECK: call {{.*}} @"\01??$WrapFnRef@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ"
OpenPOWER on IntegriCloud