xref: /minix3/external/bsd/llvm/dist/clang/test/Index/code-completion-skip-bodies.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc 
2*f4a2713aSLionel Sambuc // This is to make sure we skip function bodies.
func_to_skip()3*f4a2713aSLionel Sambuc void func_to_skip() {
4*f4a2713aSLionel Sambuc   undeclared1 = 0;
5*f4a2713aSLionel Sambuc }
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc struct S { int x; };
8*f4a2713aSLionel Sambuc 
func(S * s)9*f4a2713aSLionel Sambuc void func(S *s) {
10*f4a2713aSLionel Sambuc   undeclared2 = 0;
11*f4a2713aSLionel Sambuc   s->x = 0;
12*f4a2713aSLionel Sambuc }
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:11:6 %s 2> %t.stderr | FileCheck %s --check-prefix=STDOUT
15*f4a2713aSLionel Sambuc // RUN: FileCheck --input-file=%t.stderr --check-prefix=STDERR %s
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc // STDOUT: FieldDecl:{ResultType int}{TypedText x}
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // STDERR-NOT: error: use of undeclared identifier 'undeclared1'
20*f4a2713aSLionel Sambuc // STDERR:     error: use of undeclared identifier 'undeclared2'
21