summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-04-26 23:37:38 +0000
committerAdrian Prantl <aprantl@apple.com>2016-04-26 23:37:38 +0000
commit0dabc2adbaffc2cb9b9ab8931e7fe92734c3f342 (patch)
treeb8c1a4b1574bc7bc3fb36bd96dd628549d1a3169 /clang/test/Modules
parent807e13379b0b0ce6262de5b4c9f9d778603691a7 (diff)
downloadbcm5719-llvm-0dabc2adbaffc2cb9b9ab8931e7fe92734c3f342.tar.gz
bcm5719-llvm-0dabc2adbaffc2cb9b9ab8931e7fe92734c3f342.zip
Module debugging: Also correctly handle typedef'd foward-declared members.
Thanks again to Richard Smith for pointing this out. llvm-svn: 267630
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/ExtDebugInfo.cpp13
-rw-r--r--clang/test/Modules/Inputs/DebugCXX.h9
-rw-r--r--clang/test/Modules/ModuleDebugInfo.cpp4
3 files changed, 21 insertions, 5 deletions
diff --git a/clang/test/Modules/ExtDebugInfo.cpp b/clang/test/Modules/ExtDebugInfo.cpp
index 4760737bc4f..dbf79f4ff14 100644
--- a/clang/test/Modules/ExtDebugInfo.cpp
+++ b/clang/test/Modules/ExtDebugInfo.cpp
@@ -28,6 +28,8 @@ using DebugCXX::Struct;
Struct s;
DebugCXX::Enum e;
+
+// Template instantiations.
DebugCXX::Template<long> implicitTemplate;
DebugCXX::Template<int> explicitTemplate;
DebugCXX::FloatInstantiation typedefTemplate;
@@ -51,13 +53,16 @@ TypedefFwdDeclTemplate tdfdt;
InAnonymousNamespace anon;
-// Forward-declared in the module.
+// Types that are forward-declared in the module and defined here.
struct PureFwdDecl { int i; };
PureFwdDecl definedLocally;
struct Specialized<int>::Member { int i; };
struct Specialized<int>::Member definedLocally2;
+template <class T> struct FwdDeclTemplateMember<T>::Member { T t; };
+TypedefFwdDeclTemplateMember tdfdtm;
+
void foo() {
anon.i = GlobalStruct.i = GlobalUnion.i = GlobalEnum;
}
@@ -150,6 +155,12 @@ void foo() {
// CHECK-SAME: elements:
// CHECK-SAME: identifier: "_ZTSN11SpecializedIiE6MemberE")
+// This type is defined locally and forward-declared in the module.
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Member",
+// CHECK-SAME: elements:
+// CHECK-SAME: identifier: "_ZTSN21FwdDeclTemplateMemberIiE6MemberE")
+
+
// CHECK: !DIGlobalVariable(name: "anon_enum", {{.*}}, type: ![[ANON_ENUM:[0-9]+]]
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, scope: ![[NS]],
// CHECK-SAME: line: 16
diff --git a/clang/test/Modules/Inputs/DebugCXX.h b/clang/test/Modules/Inputs/DebugCXX.h
index 9ae74dc688f..793ad209f8b 100644
--- a/clang/test/Modules/Inputs/DebugCXX.h
+++ b/clang/test/Modules/Inputs/DebugCXX.h
@@ -97,10 +97,11 @@ template <class T> class FwdDeclTemplate;
typedef FwdDeclTemplate<int> TypedefFwdDeclTemplate;
// Member classes of class template specializations.
-template <typename T> struct Specialized {
-};
+template <typename T> struct Specialized {};
-template <> struct Specialized<int> {
-struct Member;// { int i; };
+template <> struct Specialized<int> {
+ struct Member;
};
+template <class T> struct FwdDeclTemplateMember { struct Member; };
+typedef FwdDeclTemplateMember<int>::Member TypedefFwdDeclTemplateMember;
diff --git a/clang/test/Modules/ModuleDebugInfo.cpp b/clang/test/Modules/ModuleDebugInfo.cpp
index 45023736309..998d36327ef 100644
--- a/clang/test/Modules/ModuleDebugInfo.cpp
+++ b/clang/test/Modules/ModuleDebugInfo.cpp
@@ -130,5 +130,9 @@
// CHECK-SAME: flags: DIFlagFwdDecl
// CHECK-SAME: identifier: "_ZTS15FwdDeclTemplateIiE")
+// Forward-declared member of a template.
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Member",
+// CHECK-SAME: flags: DIFlagFwdDecl
+// CHECK-SAME: identifier: "_ZTSN21FwdDeclTemplateMemberIiE6MemberE")
// CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl"
OpenPOWER on IntegriCloud