xref: /minix3/external/bsd/llvm/dist/clang/test/PCH/cxx-namespaces.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // Test this without pch.
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -include %S/cxx-namespaces.h -fsyntax-only -verify %s
3f4a2713aSLionel Sambuc 
4f4a2713aSLionel Sambuc // Test with pch.
5f4a2713aSLionel Sambuc // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-namespaces.h
6f4a2713aSLionel Sambuc // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
7*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -include-pch %t -fsyntax-only -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s
8f4a2713aSLionel Sambuc 
9f4a2713aSLionel Sambuc // Test with modules.
10f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fmodules -x c++-header -emit-pch -o %t %S/cxx-namespaces.h
11f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -verify %s
12*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc // expected-no-diagnostics
15f4a2713aSLionel Sambuc 
m()16f4a2713aSLionel Sambuc void m() {
17f4a2713aSLionel Sambuc   N::x = 0;
18f4a2713aSLionel Sambuc   N::f();
19f4a2713aSLionel Sambuc }
20f4a2713aSLionel Sambuc 
21f4a2713aSLionel Sambuc // namespace 'N' should contain only two declarations of 'f'.
22f4a2713aSLionel Sambuc 
23f4a2713aSLionel Sambuc // CHECK:      DeclarationName 'f'
24f4a2713aSLionel Sambuc // CHECK-NEXT: |-Function {{.*}} 'f' 'void (
25f4a2713aSLionel Sambuc // CHECK-NEXT: `-Function {{.*}} 'f' 'void (
26