blob: ec03156c61be6413b0993dff63fe0ec8440830e9 [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
23// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
24// RUN: c-index-test -cursor-at=%s:5:10 %s -include %t.h \
25// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \
26// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
27// RUN: -Xclang -error-on-deserialized-decl=TopVar \
28// RUN: | FileCheck %s -check-prefix=LOCAL-CURSOR1
29
30// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
31// RUN: c-index-test -cursor-at=%S/targeted-top.h:11:15 %s -include %t.h \
32// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \
33// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
34// RUN: -Xclang -error-on-deserialized-decl=vector_get_x \
35// RUN: | FileCheck %s -check-prefix=TOP-CURSOR1
36
37// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
38// RUN: c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
39// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \
40// RUN: -Xclang -error-on-deserialized-decl=TopVar \
41// RUN: | FileCheck %s -check-prefix=NESTED-CURSOR1
42
43// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
44// RUN: c-index-test -cursor-at=%S/targeted-preamble.h:2:15 %s -include %t.h \
45// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \
46// RUN: -Xclang -error-on-deserialized-decl=TopVar \
47// RUN: | FileCheck %s -check-prefix=PREAMBLE-CURSOR1
48
49// LOCAL-CURSOR1: VarDecl=LocalVar1:5:5
50// TOP-CURSOR1: VarDecl=TopVar:11:12
51// NESTED-CURSOR1: VarDecl=NestedVar1:2:12
52// PREAMBLE-CURSOR1: VarDecl=PreambleVar:2:12