diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Misc/ast-dump-lookups.cpp | 38 | ||||
| -rw-r--r-- | clang/test/Modules/cxx-templates.cpp | 4 | ||||
| -rw-r--r-- | clang/test/PCH/cxx-namespaces.cpp | 4 |
3 files changed, 42 insertions, 4 deletions
diff --git a/clang/test/Misc/ast-dump-lookups.cpp b/clang/test/Misc/ast-dump-lookups.cpp new file mode 100644 index 00000000000..5c6da48b3af --- /dev/null +++ b/clang/test/Misc/ast-dump-lookups.cpp @@ -0,0 +1,38 @@ +// 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 + +namespace Test { + extern int a; + int a = 0; +} + +namespace Test { } + +// DECLS: Dumping Test: +// DECLS-NEXT: NamespaceDecl {{.*}} Test +// 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-NEXT: `-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-NEXT: `-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 diff --git a/clang/test/Modules/cxx-templates.cpp b/clang/test/Modules/cxx-templates.cpp index b5036ff956f..1b7c045fae9 100644 --- a/clang/test/Modules/cxx-templates.cpp +++ b/clang/test/Modules/cxx-templates.cpp @@ -1,6 +1,6 @@ // RUN: rm -rf %t -// RUN: not %clang_cc1 -x objective-c++ -fmodules -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++11 -ast-dump -ast-dump-lookups | FileCheck %s --check-prefix=CHECK-GLOBAL -// RUN: not %clang_cc1 -x objective-c++ -fmodules -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter N | FileCheck %s --check-prefix=CHECK-NAMESPACE-N +// RUN: not %clang_cc1 -x objective-c++ -fmodules -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++11 -ast-dump-lookups | FileCheck %s --check-prefix=CHECK-GLOBAL +// RUN: not %clang_cc1 -x objective-c++ -fmodules -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++11 -ast-dump-lookups -ast-dump-filter N | FileCheck %s --check-prefix=CHECK-NAMESPACE-N // RUN: not %clang_cc1 -x objective-c++ -fmodules -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++11 -ast-dump | FileCheck %s --check-prefix=CHECK-DUMP // RUN: %clang_cc1 -x objective-c++ -fmodules -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11 diff --git a/clang/test/PCH/cxx-namespaces.cpp b/clang/test/PCH/cxx-namespaces.cpp index e0feaab6910..d1bf98b4ca1 100644 --- a/clang/test/PCH/cxx-namespaces.cpp +++ b/clang/test/PCH/cxx-namespaces.cpp @@ -4,12 +4,12 @@ // Test with pch. // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-namespaces.h // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -// RUN: %clang_cc1 -include-pch %t -fsyntax-only -ast-dump -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s +// RUN: %clang_cc1 -include-pch %t -fsyntax-only -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s // Test with modules. // RUN: %clang_cc1 -fmodules -x c++-header -emit-pch -o %t %S/cxx-namespaces.h // RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -verify %s -// RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -ast-dump -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s +// RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s // expected-no-diagnostics |

