1*f4a2713aSLionel Sambuc 2*f4a2713aSLionel Sambuc #include "targeted-top.h" 3*f4a2713aSLionel Sambuc #include "targeted-preamble.h" 4*f4a2713aSLionel Sambuc 5*f4a2713aSLionel Sambuc int LocalVar1; 6*f4a2713aSLionel Sambuc int LocalVar2; 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc // RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h 9*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%s:5:10 %s -include %t.h \ 10*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ 11*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=TopVar \ 12*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=LOCAL-CURSOR1 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-top.h:11:15 %s -include %t.h \ 15*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ 16*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=vector_get_x \ 17*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=TOP-CURSOR1 18*f4a2713aSLionel Sambuc 19*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ 20*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=TopVar \ 21*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=NESTED-CURSOR1 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-fields.h:2:7 %s -include %t.h \ 24*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ 25*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=TopVar \ 26*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=FIELD-CURSOR1 27*f4a2713aSLionel Sambuc 28*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-fields.h:1:1 %s -include %t.h \ 29*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ 30*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=TopVar \ 31*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=FIELD-CURSOR2 32*f4a2713aSLionel Sambuc 33*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ 34*f4a2713aSLionel Sambuc // RUN: c-index-test -cursor-at=%s:5:10 %s -include %t.h \ 35*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ 36*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ 37*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=TopVar \ 38*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=LOCAL-CURSOR1 39*f4a2713aSLionel Sambuc 40*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ 41*f4a2713aSLionel Sambuc // RUN: c-index-test -cursor-at=%S/targeted-top.h:11:15 %s -include %t.h \ 42*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ 43*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ 44*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=vector_get_x \ 45*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=TOP-CURSOR1 46*f4a2713aSLionel Sambuc 47*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ 48*f4a2713aSLionel Sambuc // RUN: c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ 49*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ 50*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=TopVar \ 51*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=NESTED-CURSOR1 52*f4a2713aSLionel Sambuc 53*f4a2713aSLionel Sambuc // RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ 54*f4a2713aSLionel Sambuc // RUN: c-index-test -cursor-at=%S/targeted-preamble.h:2:15 %s -include %t.h \ 55*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ 56*f4a2713aSLionel Sambuc // RUN: -Xclang -error-on-deserialized-decl=TopVar \ 57*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix=PREAMBLE-CURSOR1 58*f4a2713aSLionel Sambuc 59*f4a2713aSLionel Sambuc // LOCAL-CURSOR1: VarDecl=LocalVar1:5:5 60*f4a2713aSLionel Sambuc // TOP-CURSOR1: VarDecl=TopVar:11:12 61*f4a2713aSLionel Sambuc // NESTED-CURSOR1: VarDecl=NestedVar1:2:12 62*f4a2713aSLionel Sambuc // PREAMBLE-CURSOR1: VarDecl=PreambleVar:2:12 63*f4a2713aSLionel Sambuc 64*f4a2713aSLionel Sambuc // FIELD-CURSOR1: FieldDecl=z:2:7 (Definition) 65*f4a2713aSLionel Sambuc // FIELD-CURSOR2: StructDecl=:13:9 (Definition) 66