31 lines · cpp
1#ifndef HEADER12#define HEADER13 4// CHECK-TU: FunctionDecl:{ResultType void}{TypedText foo}5void foo();6 7namespace Cake {8// CHECK-NAMESPACE: FunctionDecl:{ResultType void}{TypedText lie}9void lie();10}11 12#elif !defined(HEADER2)13#define HEADER214 15namespace Cake {16extern int Baz;17}18 19#else20 21void func() {22Cake::23}24 25#endif26 27// RUN: c-index-test -write-pch %t1.h.pch %s28// RUN: c-index-test -write-pch %t2.h.pch %s -include %t1.h29// RUN: c-index-test -code-completion-at=%s:22:1 %s -include %t2.h | FileCheck -check-prefix=CHECK-TU %s30// RUN: c-index-test -code-completion-at=%s:22:7 %s -include %t2.h | FileCheck -check-prefix=CHECK-NAMESPACE %s31