blob: 0505abfa4784d7f79556cd9b855e235ca3ad93a6 [file] [log] [blame]
Douglas Gregor5f808c22010-08-16 21:18:39 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4struct StructA { };
5struct StructB { };
6struct StructC { };
7int ValueA;
8int ValueB;
9
10void f() {
11
12 int ValueA = 0;
13 int StructA = 0;
14 struct StructB { };
15
16 struct StructA sa = { };
17}
18
19// RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s
20// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s
21// CHECK-CC1: VarDecl:{ResultType int}{TypedText StructA} (8)
22// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueA} (8)
23// CHECK-CC1-NOT: VarDecl:{ResultType int}{TypedText ValueA} (50)
24// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueB} (50)
25// RUN: c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s
26// CHECK-CC2: StructDecl:{TypedText StructA} (40)
27// CHECK-CC2-NOT: StructDecl:{TypedText StructB} (40)
28// CHECK-CC2: StructDecl:{TypedText StructC} (40)
29// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s