When mangling a synthetic function declaration, we might not have
type-source information for its parameters. Don't crash when
mangling them in the MS C++ ABI. Patch by Timur Iskhodzhanov!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155879 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/mangle-ms.cpp b/test/CodeGenCXX/mangle-ms.cpp
index fe5fde1..ceaa669 100644
--- a/test/CodeGenCXX/mangle-ms.cpp
+++ b/test/CodeGenCXX/mangle-ms.cpp
@@ -103,3 +103,17 @@
void zeta(int (^)(int, int)) {}
// CHECK: @"\01?zeta@@YAXP_EAHHH@Z@Z"
+void operator_new_delete() {
+ char *ptr = new char;
+// CHECK: @"\01??2@YAPAXI@Z"
+
+ delete ptr;
+// CHECK: @"\01??3@YAXPAX@Z"
+
+ char *array = new char[42];
+// CHECK: @"\01??_U@YAPAXI@Z"
+
+ // FIXME: enable once PR12333 is fixed
+ // delete [] array;
+// Should be: @"\01??_V@YAXPAX@Z"
+}