summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
diff options
context:
space:
mode:
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