annotate clang/test/Index/code-completion-skip-bodies.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1
anatofuz
parents:
diff changeset
2 // This is to make sure we skip function bodies.
anatofuz
parents:
diff changeset
3 void func_to_skip() {
anatofuz
parents:
diff changeset
4 undeclared1 = 0;
anatofuz
parents:
diff changeset
5 }
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 struct S { int x; };
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 void func(S *s) {
anatofuz
parents:
diff changeset
10 undeclared2 = 0;
anatofuz
parents:
diff changeset
11 s->x = 0;
anatofuz
parents:
diff changeset
12 }
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 // RUN: c-index-test -code-completion-at=%s:11:6 %s 2> %t.stderr | FileCheck %s --check-prefix=STDOUT
anatofuz
parents:
diff changeset
15 // RUN: FileCheck --input-file=%t.stderr --check-prefix=STDERR %s
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // STDOUT: FieldDecl:{ResultType int}{TypedText x}
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 // STDERR-NOT: error: use of undeclared identifier 'undeclared1'
anatofuz
parents:
diff changeset
20 // STDERR: error: use of undeclared identifier 'undeclared2'