codecompletion-chained.cpp 664 B

123456789101112131415161718192021222324252627282930313233
  1. // <rdar://12889089>
  2. #ifndef HEADER1
  3. #define HEADER1
  4. // CHECK-TU: FunctionDecl:{ResultType void}{TypedText foo}
  5. void foo();
  6. namespace Cake {
  7. // CHECK-NAMESPACE: FunctionDecl:{ResultType void}{TypedText lie}
  8. void lie();
  9. }
  10. #elif !defined(HEADER2)
  11. #define HEADER2
  12. namespace Cake {
  13. extern int Baz;
  14. }
  15. #else
  16. void func() {
  17. Cake::
  18. }
  19. #endif
  20. // RUN: c-index-test -write-pch %t1.h.pch %s
  21. // RUN: c-index-test -write-pch %t2.h.pch %s -include %t1.h
  22. // RUN: c-index-test -code-completion-at=%s:25:1 %s -include %t2.h | FileCheck -check-prefix=CHECK-TU %s
  23. // RUN: c-index-test -code-completion-at=%s:25:7 %s -include %t2.h | FileCheck -check-prefix=CHECK-NAMESPACE %s