summaryrefslogtreecommitdiff
path: root/test/Misc
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-09-22 00:11:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-09-22 00:11:15 +0000
commit0b5ac08821c0efb80531b9bcfdae8c2204e75ff9 (patch)
treeb9985add481bb6029d2872d73893840617d13fc2 /test/Misc
parent7eb7e99e4dca89571e26e9c30f82e38a9219a38a (diff)
Extend -ast-dump for CXXRecordDecl to dump the flags from the DefinitionData.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Misc')
-rw-r--r--test/Misc/ast-dump-decl.cpp54
-rw-r--r--test/Misc/ast-dump-invalid.cpp2
-rw-r--r--test/Misc/pragma-attribute-cxx-subject-match-rules.cpp10
-rw-r--r--test/Misc/pragma-attribute-cxx.cpp4
4 files changed, 44 insertions, 26 deletions
diff --git a/test/Misc/ast-dump-decl.cpp b/test/Misc/ast-dump-decl.cpp
index a48261d367..0df8a5a2b8 100644
--- a/test/Misc/ast-dump-decl.cpp
+++ b/test/Misc/ast-dump-decl.cpp
@@ -73,6 +73,16 @@ namespace testTypeAliasTemplateDecl {
// CHECK-NEXT: TypeAliasDecl{{.*}} TestTypeAliasTemplateDecl 'A<T>'
namespace testCXXRecordDecl {
+ class TestEmpty {};
+// CHECK: CXXRecordDecl{{.*}} class TestEmpty
+// CHECK-NEXT: DefinitionData pass_in_registers empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init
+// CHECK-NEXT: DefaultConstructor exists trivial constexpr
+// CHECK-NEXT: CopyConstructor simple trivial has_const_param
+// CHECK-NEXT: MoveConstructor exists simple trivial
+// CHECK-NEXT: CopyAssignment trivial has_const_param
+// CHECK-NEXT: MoveAssignment exists simple trivial
+// CHECK-NEXT: Destructor simple irrelevant trivial
+
class A { };
class B { };
class TestCXXRecordDecl : virtual A, public B {
@@ -80,6 +90,13 @@ namespace testCXXRecordDecl {
};
}
// CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDecl
+// CHECK-NEXT: DefinitionData{{$}}
+// CHECK-NEXT: DefaultConstructor exists non_trivial
+// CHECK-NEXT: CopyConstructor simple non_trivial has_const_param
+// CHECK-NEXT: MoveConstructor exists simple non_trivial
+// CHECK-NEXT: CopyAssignment non_trivial has_const_param
+// CHECK-NEXT: MoveAssignment exists simple non_trivial
+// CHECK-NEXT: Destructor simple irrelevant trivial
// CHECK-NEXT: virtual private 'class testCXXRecordDecl::A'
// CHECK-NEXT: public 'class testCXXRecordDecl::B'
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDecl
@@ -89,7 +106,7 @@ template<class...T>
class TestCXXRecordDeclPack : public T... {
};
// CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack
-// CHECK-NEXT: public 'T'...
+// CHECK: public 'T'...
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack
thread_local int TestThreadLocalInt;
@@ -250,14 +267,14 @@ namespace testClassTemplateDecl {
// CHECK: ClassTemplateDecl{{.*}} TestClassTemplate
// CHECK-NEXT: TemplateTypeParmDecl
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
-// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
+// CHECK: CXXRecordDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: AccessSpecDecl{{.*}} public
// CHECK-NEXT: CXXConstructorDecl{{.*}} <line:{{.*}}:5, col:23>
// CHECK-NEXT: CXXDestructorDecl{{.*}} <line:{{.*}}:5, col:24>
// CHECK-NEXT: CXXMethodDecl{{.*}} <line:{{.*}}:5, col:11>
// CHECK-NEXT: FieldDecl{{.*}} i
// CHECK-NEXT: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
-// CHECK-NEXT: TemplateArgument{{.*}}A
+// CHECK: TemplateArgument{{.*}}A
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: AccessSpecDecl{{.*}} public
// CHECK-NEXT: CXXConstructorDecl{{.*}} <line:{{.*}}:5, col:23>
@@ -269,12 +286,13 @@ namespace testClassTemplateDecl {
// CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate'
// CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
-// CHECK-NEXT: TemplateArgument{{.*}}B
+// CHECK-NEXT: DefinitionData
+// CHECK: TemplateArgument{{.*}}B
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: FieldDecl{{.*}} j
// CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
-// CHECK-NEXT: TemplateArgument{{.*}}C
+// CHECK: TemplateArgument{{.*}}C
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: AccessSpecDecl{{.*}} public
// CHECK-NEXT: CXXConstructorDecl{{.*}} <line:{{.*}}:5, col:23>
@@ -283,7 +301,7 @@ namespace testClassTemplateDecl {
// CHECK-NEXT: FieldDecl{{.*}} i
// CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
-// CHECK-NEXT: TemplateArgument{{.*}}D
+// CHECK: TemplateArgument{{.*}}D
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: AccessSpecDecl{{.*}} public
// CHECK-NEXT: CXXConstructorDecl{{.*}} <line:{{.*}}:5, col:23>
@@ -292,7 +310,7 @@ namespace testClassTemplateDecl {
// CHECK-NEXT: FieldDecl{{.*}} i
// CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class TestClassTemplatePartial
-// CHECK-NEXT: TemplateArgument
+// CHECK: TemplateArgument
// CHECK-NEXT: TemplateArgument{{.*}}A
// CHECK-NEXT: TemplateTypeParmDecl
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplatePartial
@@ -326,13 +344,13 @@ namespace testCanonicalTemplate {
// CHECK: ClassTemplateDecl{{.*}} TestClassTemplate
// CHECK-NEXT: TemplateTypeParmDecl
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
- // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
+ // CHECK: CXXRecordDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: FriendDecl
// CHECK-NEXT: ClassTemplateDecl{{.*}} TestClassTemplate
// CHECK-NEXT: TemplateTypeParmDecl
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
- // CHECK-NEXT: TemplateArgument{{.*}}A
+ // CHECK: TemplateArgument{{.*}}A
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
}
@@ -384,27 +402,27 @@ namespace TestTemplateArgument {
template<typename> class testType { };
template class testType<int>;
// CHECK: ClassTemplateSpecializationDecl{{.*}} class testType
- // CHECK-NEXT: TemplateArgument{{.*}} type 'int'
+ // CHECK: TemplateArgument{{.*}} type 'int'
template<int fp(void)> class testDecl { };
template class testDecl<foo>;
// CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl
- // CHECK-NEXT: TemplateArgument{{.*}} decl
+ // CHECK: TemplateArgument{{.*}} decl
// CHECK-NEXT: Function{{.*}}foo
template class testDecl<nullptr>;
// CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl
- // CHECK-NEXT: TemplateArgument{{.*}} nullptr
+ // CHECK: TemplateArgument{{.*}} nullptr
template<int> class testIntegral { };
template class testIntegral<1>;
// CHECK: ClassTemplateSpecializationDecl{{.*}} class testIntegral
- // CHECK-NEXT: TemplateArgument{{.*}} integral 1
+ // CHECK: TemplateArgument{{.*}} integral 1
template<template<typename> class> class testTemplate { };
template class testTemplate<A>;
// CHECK: ClassTemplateSpecializationDecl{{.*}} class testTemplate
- // CHECK-NEXT: TemplateArgument{{.*}} A
+ // CHECK: TemplateArgument{{.*}} A
template<template<typename> class ...T> class C {
B<T...> testTemplateExpansion;
@@ -414,13 +432,13 @@ namespace TestTemplateArgument {
template<int, int = 0> class testExpr;
template<int I> class testExpr<I> { };
// CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class testExpr
- // CHECK-NEXT: TemplateArgument{{.*}} expr
+ // CHECK: TemplateArgument{{.*}} expr
// CHECK-NEXT: DeclRefExpr{{.*}}I
template<int, int ...> class testPack { };
template class testPack<0, 1, 2>;
// CHECK: ClassTemplateSpecializationDecl{{.*}} class testPack
- // CHECK-NEXT: TemplateArgument{{.*}} integral 0
+ // CHECK: TemplateArgument{{.*}} integral 0
// CHECK-NEXT: TemplateArgument{{.*}} pack
// CHECK-NEXT: TemplateArgument{{.*}} integral 1
// CHECK-NEXT: TemplateArgument{{.*}} integral 2
@@ -467,7 +485,7 @@ private:
protected:
};
// CHECK: CXXRecordDecl{{.*}} class TestAccessSpecDecl
-// CHECK-NEXT: CXXRecordDecl{{.*}} class TestAccessSpecDecl
+// CHECK: CXXRecordDecl{{.*}} class TestAccessSpecDecl
// CHECK-NEXT: AccessSpecDecl{{.*}} public
// CHECK-NEXT: AccessSpecDecl{{.*}} private
// CHECK-NEXT: AccessSpecDecl{{.*}} protected
@@ -478,7 +496,7 @@ template<typename T> class TestFriendDecl {
friend T;
};
// CHECK: CXXRecord{{.*}} TestFriendDecl
-// CHECK-NEXT: CXXRecord{{.*}} TestFriendDecl
+// CHECK: CXXRecord{{.*}} TestFriendDecl
// CHECK-NEXT: FriendDecl
// CHECK-NEXT: FunctionDecl{{.*}} foo
// CHECK-NEXT: FriendDecl{{.*}} 'class A':'class A'
diff --git a/test/Misc/ast-dump-invalid.cpp b/test/Misc/ast-dump-invalid.cpp
index aa6cd52692..842b057a4a 100644
--- a/test/Misc/ast-dump-invalid.cpp
+++ b/test/Misc/ast-dump-invalid.cpp
@@ -51,7 +51,7 @@ double Str::foo1(double, invalid_type)
}
// CHECK: NamespaceDecl {{.*}} <{{.*}}> {{.*}} TestInvalidFunctionDecl
// CHECK-NEXT: |-CXXRecordDecl {{.*}} <line:46:1, line:48:1> line:46:8 struct Str definition
-// CHECK-NEXT: | |-CXXRecordDecl {{.*}} <col:1, col:8> col:8 implicit struct Str
+// CHECK: | |-CXXRecordDecl {{.*}} <col:1, col:8> col:8 implicit struct Str
// CHECK-NEXT: | `-CXXMethodDecl {{.*}} <line:47:4, col:36> col:11 invalid foo1 'double (double, int)'
// CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:16> col:22 'double'
// CHECK-NEXT: | `-ParmVarDecl {{.*}} <col:24, <invalid sloc>> col:36 invalid 'int'
diff --git a/test/Misc/pragma-attribute-cxx-subject-match-rules.cpp b/test/Misc/pragma-attribute-cxx-subject-match-rules.cpp
index b7741343ad..18dfb43a38 100644
--- a/test/Misc/pragma-attribute-cxx-subject-match-rules.cpp
+++ b/test/Misc/pragma-attribute-cxx-subject-match-rules.cpp
@@ -44,9 +44,9 @@ struct testStructRecord {
int testStructRecordField;
};
// CHECK-RECORD: CXXRecordDecl{{.*}} testStructRecord
-// CHECK-RECORD-NEXT: AnnotateAttr{{.*}} "test"
+// CHECK-RECORD: AnnotateAttr{{.*}} "test"
// CHECK-RECORD_UNLESS_IS_UNION-LABEL: CXXRecordDecl{{.*}} testStructRecord
-// CHECK-RECORD_UNLESS_IS_UNION-NEXT: AnnotateAttr{{.*}} "test"
+// CHECK-RECORD_UNLESS_IS_UNION: AnnotateAttr{{.*}} "test"
// CHECK-FIELD: FieldDecl{{.*}} testStructRecordField
// CHECK-FIELD-NEXT: AnnotateAttr{{.*}} "test"
@@ -54,9 +54,9 @@ class testClassRecord {
int testClassRecordField;
};
// CHECK-RECORD: CXXRecordDecl{{.*}} testClassRecord
-// CHECK-RECORD-NEXT: AnnotateAttr{{.*}} "test"
+// CHECK-RECORD: AnnotateAttr{{.*}} "test"
// CHECK-RECORD_UNLESS_IS_UNION-LABEL: CXXRecordDecl{{.*}} testClassRecord
-// CHECK-RECORD_UNLESS_IS_UNION-NEXT: AnnotateAttr{{.*}} "test"
+// CHECK-RECORD_UNLESS_IS_UNION: AnnotateAttr{{.*}} "test"
// CHECK-FIELD: FieldDecl{{.*}} testClassRecordField
// CHECK-FIELD-NEXT: AnnotateAttr{{.*}} "test"
@@ -64,7 +64,7 @@ union testUnionRecord {
int testUnionRecordField;
};
// CHECK-RECORD: CXXRecordDecl{{.*}} testUnionRecord
-// CHECK-RECORD-NEXT: AnnotateAttr{{.*}} "test"
+// CHECK-RECORD: AnnotateAttr{{.*}} "test"
// CHECK-RECORD_UNLESS_IS_UNION-LABEL: CXXRecordDecl{{.*}} testUnionRecord
// CHECK-RECORD_UNLESS_IS_UNION-NOT: AnnotateAttr{{.*}} "test"
// CHECK-FIELD: FieldDecl{{.*}} testUnionRecordField
diff --git a/test/Misc/pragma-attribute-cxx.cpp b/test/Misc/pragma-attribute-cxx.cpp
index c241c4e4bd..a8a3bdebc6 100644
--- a/test/Misc/pragma-attribute-cxx.cpp
+++ b/test/Misc/pragma-attribute-cxx.cpp
@@ -17,7 +17,7 @@ class testClass2 {
testClass2 *operator -> ();
};
// CHECK-LABEL: CXXRecordDecl{{.*}} testClass2
-// CHECK-NEXT: AnnotateAttr{{.*}} "test"
+// CHECK: AnnotateAttr{{.*}} "test"
// CHECK: CXXMethodDecl{{.*}} testMethod1
// CHECK-NEXT: ParmVarDecl{{.*}} param
// CHECK-NEXT: AnnotateAttr{{.*}} "test"
@@ -76,7 +76,7 @@ void testLambdaMethod() {
// CHECK-LABEL: FunctionDecl{{.*}} testLambdaMethod
// CHECK: LambdaExpr
// CHECK-NEXT: CXXRecordDecl
-// CHECK-NEXT: CXXMethodDecl{{.*}} operator()
+// CHECK: CXXMethodDecl{{.*}} operator()
// CHECK-NEXT: CompoundStmt
// CHECK-NEXT: AnnotateAttr{{.*}} "test"