Implements mangling of local class names to
fix a code gen crash. This is WIP as not
all ABI cases are covered (there is a FIXME to
this effect). Fixes radar 7696748.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97658 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/mangle-local-class-names.cpp b/test/CodeGenCXX/mangle-local-class-names.cpp
new file mode 100644
index 0000000..2726f5e
--- /dev/null
+++ b/test/CodeGenCXX/mangle-local-class-names.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: @_ZZ4FUNCvEN4SSSSC1ERKf
+// CHECK: @_ZZ4FUNCvEN4SSSSC2E_0RKf
+
+void FUNC ()
+{
+ {
+ float IVAR1 ;
+
+ struct SSSS
+ {
+ float bv;
+ SSSS( const float& from): bv(from) { }
+ };
+
+ SSSS VAR1(IVAR1);
+ }
+
+ {
+ float IVAR2 ;
+
+ struct SSSS
+ {
+ SSSS( const float& from) {}
+ };
+
+ SSSS VAR2(IVAR2);
+ }
+}