aboutsummaryrefslogtreecommitdiff
path: root/test/PCH/cxx-namespaces.cpp
blob: e0feaab6910a0a56aeb6ec1781cf683d1e451178 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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 -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

// 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 (