blob: 1aabd5f5a291be6b4eb73cd247e0b46b7f434767 [file] [log] [blame]
Sam McCallbb2cf632018-01-12 14:51:47 +00001namespace ns {
2int bar;
3}
4
5int main() { return ns:: }
6
7// RUN: echo "namespace ns { int foo; }" > %t.h
8// RUN: c-index-test -write-pch %t.h.pch -x c++-header %t.h
9//
10// RUN: c-index-test -code-completion-at=%s:5:26 -include %t.h %s | FileCheck -check-prefix=WITH-PCH %s
11// WITH-PCH: {TypedText bar}
12// WITH-PCH: {TypedText foo}
13
14// RUN: env CINDEXTEST_COMPLETION_SKIP_PREAMBLE=1 c-index-test -code-completion-at=%s:5:26 -include %t.h %s | FileCheck -check-prefix=SKIP-PCH %s
15// SKIP-PCH-NOT: foo
16// SKIP-PCH: {TypedText bar}
17// SKIP-PCH-NOT: foo
18
Sam McCall091b1ef2018-01-16 12:33:46 +000019// Verify that with *no* preamble (no -include flag) we still get local results.
20// SkipPreamble used to break this, by making lookup *too* lazy.
21// RUN: env CINDEXTEST_COMPLETION_SKIP_PREAMBLE=1 c-index-test -code-completion-at=%s:5:26 %s | FileCheck -check-prefix=NO-PCH %s
22// NO-PCH-NOT: foo
23// NO-PCH: {TypedText bar}
24// NO-PCH-NOT: foo
25