xref: /llvm-project/clang/test/Index/codecompletion-chained.cpp (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 #ifndef HEADER1
2 #define HEADER1
3 
4 // CHECK-TU: FunctionDecl:{ResultType void}{TypedText foo}
5 void foo();
6 
7 namespace Cake {
8 // CHECK-NAMESPACE: FunctionDecl:{ResultType void}{TypedText lie}
9 void lie();
10 }
11 
12 #elif !defined(HEADER2)
13 #define HEADER2
14 
15 namespace Cake {
16 extern int Baz;
17 }
18 
19 #else
20 
func()21 void func() {
22 Cake::
23 }
24 
25 #endif
26 
27 // RUN: c-index-test -write-pch %t1.h.pch %s
28 // RUN: c-index-test -write-pch %t2.h.pch %s -include %t1.h
29 // RUN: c-index-test -code-completion-at=%s:22:1 %s -include %t2.h | FileCheck -check-prefix=CHECK-TU %s
30 // RUN: c-index-test -code-completion-at=%s:22:7 %s -include %t2.h | FileCheck -check-prefix=CHECK-NAMESPACE %s
31