2014-08-12 06:11:07 +08:00
|
|
|
// 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
|
2016-01-13 05:59:26 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only %s 2>&1 | FileCheck -check-prefix PRAGMA %s
|
2014-08-12 06:11:07 +08:00
|
|
|
|
|
|
|
namespace Test {
|
2016-01-13 05:59:26 +08:00
|
|
|
typedef int T;
|
2014-08-12 06:11:07 +08:00
|
|
|
extern int a;
|
|
|
|
int a = 0;
|
|
|
|
}
|
|
|
|
|
2016-01-13 05:59:26 +08:00
|
|
|
#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
|
|
|
|
|
2014-08-12 06:11:07 +08:00
|
|
|
namespace Test { }
|
|
|
|
|
|
|
|
// DECLS: Dumping Test:
|
|
|
|
// DECLS-NEXT: NamespaceDecl {{.*}} Test
|
2016-01-13 05:59:26 +08:00
|
|
|
// DECLS-NEXT: |-TypedefDecl {{.*}} T 'int'
|
|
|
|
// DECLS-NEXT: | `-BuiltinType {{.*}} 'int'
|
2014-08-12 06:11:07 +08:00
|
|
|
// 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'
|
2016-01-13 05:59:26 +08:00
|
|
|
// LOOKUPS: DeclarationName 'a'
|
|
|
|
// LOOKUPS-NEXT: `-Var {{.*}} 'a' 'int'
|
2014-08-12 06:11:07 +08:00
|
|
|
//
|
|
|
|
// LOOKUPS: Dumping Test:
|
|
|
|
// LOOKUPS-NEXT: Lookup map is in primary DeclContext
|
|
|
|
|
|
|
|
// DECLS-LOOKUPS: Dumping Test:
|
|
|
|
// DECLS-LOOKUPS-NEXT: StoredDeclsMap Namespace {{.*}} 'Test'
|
2016-01-13 05:59:26 +08:00
|
|
|
// DECLS-LOOKUPS: -DeclarationName 'a'
|
2014-08-12 06:11:07 +08:00
|
|
|
// 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
|