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