llvm-capstone/clang/test/PCH/cxx-namespaces.cpp
Richard Smith 35f986d3cd Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dump
anyway. If -ast-dump *is* also provided, then dump the AST declarations as well
as the lookup results. This is invaluable for cross-correlating the lookup
information with the declarations actually found.

llvm-svn: 215393
2014-08-11 22:11:07 +00:00

26 lines
890 B
C++

// Test this without pch.
// RUN: %clang_cc1 -include %S/cxx-namespaces.h -fsyntax-only -verify %s
// 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-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-lookups -ast-dump-filter N %s | FileCheck %s
// expected-no-diagnostics
void m() {
N::x = 0;
N::f();
}
// namespace 'N' should contain only two declarations of 'f'.
// CHECK: DeclarationName 'f'
// CHECK-NEXT: |-Function {{.*}} 'f' 'void (
// CHECK-NEXT: `-Function {{.*}} 'f' 'void (