cxx-namespaces.cpp 890 B

12345678910111213141516171819202122232425
  1. // Test this without pch.
  2. // RUN: %clang_cc1 -include %S/cxx-namespaces.h -fsyntax-only -verify %s
  3. // Test with pch.
  4. // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-namespaces.h
  5. // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
  6. // RUN: %clang_cc1 -include-pch %t -fsyntax-only -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s
  7. // Test with modules.
  8. // RUN: %clang_cc1 -fmodules -x c++-header -emit-pch -o %t %S/cxx-namespaces.h
  9. // RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -verify %s
  10. // RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s
  11. // expected-no-diagnostics
  12. void m() {
  13. N::x = 0;
  14. N::f();
  15. }
  16. // namespace 'N' should contain only two declarations of 'f'.
  17. // CHECK: DeclarationName 'f'
  18. // CHECK-NEXT: |-Function {{.*}} 'f' 'void (
  19. // CHECK-NEXT: `-Function {{.*}} 'f' 'void (