blob: b6579d1804a1e7a070486de08866602245acc9db [file] [log] [blame]
Argyrios Kyrtzidise9681522011-11-03 02:20:32 +00001
2#include "targeted-top.h"
3#include "targeted-preamble.h"
4
5int LocalVar1;
6int LocalVar2;
7
8// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h
9// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%s:5:10 %s -include %t.h \
10// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
11// RUN: -Xclang -error-on-deserialized-decl=TopVar \
12// RUN: | FileCheck %s -check-prefix=LOCAL-CURSOR1
13
14// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-top.h:11:15 %s -include %t.h \
15// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
16// RUN: -Xclang -error-on-deserialized-decl=vector_get_x \
17// RUN: | FileCheck %s -check-prefix=TOP-CURSOR1
18
19// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
20// RUN: -Xclang -error-on-deserialized-decl=TopVar \
21// RUN: | FileCheck %s -check-prefix=NESTED-CURSOR1
22
Argyrios Kyrtzidisdeb47d12011-11-03 19:01:07 +000023// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-fields.h:2:7 %s -include %t.h \
24// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
25// RUN: -Xclang -error-on-deserialized-decl=TopVar \
26// RUN: | FileCheck %s -check-prefix=FIELD-CURSOR1
27
Argyrios Kyrtzidise9681522011-11-03 02:20:32 +000028// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
29// RUN: c-index-test -cursor-at=%s:5:10 %s -include %t.h \
30// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \
31// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
32// RUN: -Xclang -error-on-deserialized-decl=TopVar \
33// RUN: | FileCheck %s -check-prefix=LOCAL-CURSOR1
34
35// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
36// RUN: c-index-test -cursor-at=%S/targeted-top.h:11:15 %s -include %t.h \
37// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \
38// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
39// RUN: -Xclang -error-on-deserialized-decl=vector_get_x \
40// RUN: | FileCheck %s -check-prefix=TOP-CURSOR1
41
42// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
43// RUN: c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
44// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \
45// RUN: -Xclang -error-on-deserialized-decl=TopVar \
46// RUN: | FileCheck %s -check-prefix=NESTED-CURSOR1
47
48// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
49// RUN: c-index-test -cursor-at=%S/targeted-preamble.h:2:15 %s -include %t.h \
50// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
51// RUN: -Xclang -error-on-deserialized-decl=TopVar \
52// RUN: | FileCheck %s -check-prefix=PREAMBLE-CURSOR1
53
54// LOCAL-CURSOR1: VarDecl=LocalVar1:5:5
55// TOP-CURSOR1: VarDecl=TopVar:11:12
56// NESTED-CURSOR1: VarDecl=NestedVar1:2:12
57// PREAMBLE-CURSOR1: VarDecl=PreambleVar:2:12
Argyrios Kyrtzidisdeb47d12011-11-03 19:01:07 +000058// FIELD-CURSOR1: FieldDecl=z:2:7 (Definition)