Richard Smith | 35f986d | 2014-08-11 22:11:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix DECLS %s |
| 2 | // RUN: %clang_cc1 -std=c++11 -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix LOOKUPS %s |
| 3 | // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix DECLS-LOOKUPS %s |
| 4 | |
| 5 | namespace Test { |
| 6 | extern int a; |
| 7 | int a = 0; |
| 8 | } |
| 9 | |
| 10 | namespace Test { } |
| 11 | |
| 12 | // DECLS: Dumping Test: |
| 13 | // DECLS-NEXT: NamespaceDecl {{.*}} Test |
| 14 | // DECLS-NEXT: |-VarDecl [[EXTERN_A:0x[^ ]*]] {{.*}} a 'int' extern |
| 15 | // DECLS-NEXT: `-VarDecl {{.*}} prev [[EXTERN_A]] {{.*}} a 'int' cinit |
| 16 | // DECLS-NEXT: `-IntegerLiteral {{.*}} 'int' 0 |
| 17 | // |
| 18 | // DECLS: Dumping Test: |
| 19 | // DECLS-NEXT: NamespaceDecl {{.*}} Test |
| 20 | |
| 21 | // LOOKUPS: Dumping Test: |
| 22 | // LOOKUPS-NEXT: StoredDeclsMap Namespace {{.*}} 'Test' |
| 23 | // LOOKUPS-NEXT: `-DeclarationName 'a' |
| 24 | // LOOKUPS-NEXT: `-Var {{.*}} 'a' 'int' |
| 25 | // |
| 26 | // LOOKUPS: Dumping Test: |
| 27 | // LOOKUPS-NEXT: Lookup map is in primary DeclContext |
| 28 | |
| 29 | // DECLS-LOOKUPS: Dumping Test: |
| 30 | // DECLS-LOOKUPS-NEXT: StoredDeclsMap Namespace {{.*}} 'Test' |
| 31 | // DECLS-LOOKUPS-NEXT: `-DeclarationName 'a' |
| 32 | // DECLS-LOOKUPS-NEXT: `-Var [[A:[^ ]*]] 'a' 'int' |
| 33 | // DECLS-LOOKUPS-NEXT: |-VarDecl [[EXTERN_A:0x[^ ]*]] {{.*}} a 'int' extern |
| 34 | // DECLS-LOOKUPS-NEXT: `-VarDecl [[A]] prev [[EXTERN_A]] {{.*}} a 'int' cinit |
| 35 | // DECLS-LOOKUPS-NEXT: `-IntegerLiteral {{.*}} 'int' 0 |
| 36 | // |
| 37 | // DECLS-LOOKUPS: Dumping Test: |
| 38 | // DECLS-LOOKUPS-NEXT: Lookup map is in primary DeclContext |