26 lines · cpp
1// Test this without pch.2// RUN: %clang_cc1 -include %S/cxx-namespaces.h -fsyntax-only -verify %s3 4// Test with pch.5// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-namespaces.h6// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s7// RUN: %clang_cc1 -include-pch %t -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s8 9// Test with modules.10// RUN: %clang_cc1 -fmodules -x c++-header -emit-pch -o %t %S/cxx-namespaces.h11// RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -verify %s12// RUN: %clang_cc1 -fmodules -include-pch %t -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s13 14// expected-no-diagnostics15 16void m() {17 N::x = 0;18 N::f();19}20 21// namespace 'N' should contain only two declarations of 'f'.22 23// CHECK: DeclarationName 'f'24// CHECK-NEXT: |-Function {{.*}} 'f' 'void (25// CHECK-NEXT: `-Function {{.*}} 'f' 'void (26