xref: /minix3/external/bsd/llvm/dist/clang/test/Index/complete-hiding.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // Note: the run lines follow their respective tests, since line/column
2*f4a2713aSLionel Sambuc // matter in this test.
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc struct StructA { };
5*f4a2713aSLionel Sambuc struct StructB { };
6*f4a2713aSLionel Sambuc struct StructC { };
7*f4a2713aSLionel Sambuc int ValueA;
8*f4a2713aSLionel Sambuc int ValueB;
9*f4a2713aSLionel Sambuc 
f()10*f4a2713aSLionel Sambuc void f() {
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc   int ValueA = 0;
13*f4a2713aSLionel Sambuc   int StructA = 0;
14*f4a2713aSLionel Sambuc   struct StructB { };
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc   struct StructA sa = { };
17*f4a2713aSLionel Sambuc }
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:16:3 %s > %t
20*f4a2713aSLionel Sambuc // RUN: FileCheck -check-prefix=CHECK-CC1 -input-file=%t %s
21*f4a2713aSLionel Sambuc // 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
22*f4a2713aSLionel Sambuc // CHECK-CC1: VarDecl:{ResultType int}{TypedText StructA} (34)
23*f4a2713aSLionel Sambuc // CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueA} (34)
24*f4a2713aSLionel Sambuc // CHECK-CC1-NOT: VarDecl:{ResultType int}{TypedText ValueA} (50)
25*f4a2713aSLionel Sambuc // CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueB} (50)
26*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:16:10 %s > %t
27*f4a2713aSLionel Sambuc // RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s
28*f4a2713aSLionel Sambuc // CHECK-CC2: StructDecl:{TypedText StructA} (50)
29*f4a2713aSLionel Sambuc // CHECK-CC2-NOT: StructDecl:{TypedText StructB} (50)
30*f4a2713aSLionel Sambuc // CHECK-CC2: StructDecl:{TypedText StructC} (50)
31*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s > %t
32*f4a2713aSLionel Sambuc // RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s
33