diff options
author | Jordan Rupprecht <rupprecht@google.com> | 2018-12-19 02:24:12 +0000 |
---|---|---|
committer | Jordan Rupprecht <rupprecht@google.com> | 2018-12-19 02:24:12 +0000 |
commit | 55c8788102d8fd203270fabd6513247b2d7fbd87 (patch) | |
tree | 63ab727404da1afaca89c6578f37f135a50922e7 /test/AST/ast-dump-lookups.cpp | |
parent | 9fa0a1f211b7c9a402767bc895a87481cf347230 (diff) | |
parent | 46efdf2ccc2a80aefebf8433dbf9c7c959f6e629 (diff) |
Creating branches/google/stable and tags/google/stable/2018-12-18 from r349201
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/google/stable@349597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/AST/ast-dump-lookups.cpp')
-rw-r--r-- | test/AST/ast-dump-lookups.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/AST/ast-dump-lookups.cpp b/test/AST/ast-dump-lookups.cpp new file mode 100644 index 0000000000..2d235010cb --- /dev/null +++ b/test/AST/ast-dump-lookups.cpp @@ -0,0 +1,53 @@ +// RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix DECLS %s +// RUN: %clang_cc1 -std=c++11 -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix LOOKUPS %s +// RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix DECLS-LOOKUPS %s +// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only %s 2>&1 | FileCheck -check-prefix PRAGMA %s + +namespace Test { + typedef int T; + extern int a; + int a = 0; +} + +#ifdef PRAGMA +#pragma clang __debug dump Test +// PRAGMA: lookup results for Test: +// PRAGMA-NEXT: NamespaceDecl {{.*}} Test +// PRAGMA-NEXT: |-TypedefDecl {{.*}} T 'int' +// PRAGMA-NEXT: | `-BuiltinType {{.*}} 'int' +// PRAGMA-NEXT: |-VarDecl [[EXTERN_A:0x[^ ]*]] {{.*}} a 'int' extern +// PRAGMA-NEXT: `-VarDecl {{.*}} prev [[EXTERN_A]] {{.*}} a 'int' cinit +// PRAGMA-NEXT: `-IntegerLiteral {{.*}} 'int' 0 +#endif + +namespace Test { } + +// DECLS: Dumping Test: +// DECLS-NEXT: NamespaceDecl {{.*}} Test +// DECLS-NEXT: |-TypedefDecl {{.*}} T 'int' +// DECLS-NEXT: | `-BuiltinType {{.*}} 'int' +// DECLS-NEXT: |-VarDecl [[EXTERN_A:0x[^ ]*]] {{.*}} a 'int' extern +// DECLS-NEXT: `-VarDecl {{.*}} prev [[EXTERN_A]] {{.*}} a 'int' cinit +// DECLS-NEXT: `-IntegerLiteral {{.*}} 'int' 0 +// +// DECLS: Dumping Test: +// DECLS-NEXT: NamespaceDecl {{.*}} Test + +// LOOKUPS: Dumping Test: +// LOOKUPS-NEXT: StoredDeclsMap Namespace {{.*}} 'Test' +// LOOKUPS: DeclarationName 'a' +// LOOKUPS-NEXT: `-Var {{.*}} 'a' 'int' +// +// LOOKUPS: Dumping Test: +// LOOKUPS-NEXT: Lookup map is in primary DeclContext + +// DECLS-LOOKUPS: Dumping Test: +// DECLS-LOOKUPS-NEXT: StoredDeclsMap Namespace {{.*}} 'Test' +// DECLS-LOOKUPS: -DeclarationName 'a' +// DECLS-LOOKUPS-NEXT: `-Var [[A:[^ ]*]] 'a' 'int' +// DECLS-LOOKUPS-NEXT: |-VarDecl [[EXTERN_A:0x[^ ]*]] {{.*}} a 'int' extern +// DECLS-LOOKUPS-NEXT: `-VarDecl [[A]] prev [[EXTERN_A]] {{.*}} a 'int' cinit +// DECLS-LOOKUPS-NEXT: `-IntegerLiteral {{.*}} 'int' 0 +// +// DECLS-LOOKUPS: Dumping Test: +// DECLS-LOOKUPS-NEXT: Lookup map is in primary DeclContext |