brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.5 KiB · daf3098 Raw
100 lines · c
1 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.h9// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%s:1:1:7:1 %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=LOCAL13 14// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \15// RUN:   c-index-test -test-annotate-tokens=%s:1:1:7:1 %s -include %t.h \16// RUN:    -Xclang -error-on-deserialized-decl=PreambleVar  \17// RUN:    -Xclang -error-on-deserialized-decl=NestedVar1  \18// RUN:    -Xclang -error-on-deserialized-decl=TopVar  \19// RUN:  | FileCheck %s -check-prefix=LOCAL20 21// LOCAL: Punctuation: "#" [2:1 - 2:2] inclusion directive=targeted-top.h22// LOCAL: Identifier: "include" [2:2 - 2:9] inclusion directive=targeted-top.h23// LOCAL: Literal: ""targeted-top.h"" [2:10 - 2:26] inclusion directive=targeted-top.h24// LOCAL: Punctuation: "#" [3:1 - 3:2] inclusion directive=targeted-preamble.h25// LOCAL: Identifier: "include" [3:2 - 3:9] inclusion directive=targeted-preamble.h26// LOCAL: Literal: ""targeted-preamble.h"" [3:10 - 3:31] inclusion directive=targeted-preamble.h27// LOCAL: Keyword: "int" [5:1 - 5:4] VarDecl=LocalVar1:5:528// LOCAL: Identifier: "LocalVar1" [5:5 - 5:14] VarDecl=LocalVar1:5:529// LOCAL: Punctuation: ";" [5:14 - 5:15]30// LOCAL: Keyword: "int" [6:1 - 6:4] VarDecl=LocalVar2:6:531// LOCAL: Identifier: "LocalVar2" [6:5 - 6:14] VarDecl=LocalVar2:6:532// LOCAL: Punctuation: ";" [6:14 - 6:15]33 34// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%S/targeted-fields.h:1:1:4:1 %s -include %t.h \35// RUN:    -Xclang -error-on-deserialized-decl=NestedVar1  \36// RUN:    -Xclang -error-on-deserialized-decl=TopVar  \37// RUN:  | FileCheck %s -check-prefix=FIELD38 39// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \40// RUN:   c-index-test -test-annotate-tokens=%S/targeted-fields.h:1:1:4:1 %s -include %t.h \41// RUN:    -Xclang -error-on-deserialized-decl=PreambleVar  \42// RUN:    -Xclang -error-on-deserialized-decl=NestedVar1  \43// RUN:    -Xclang -error-on-deserialized-decl=TopVar  \44// RUN:  | FileCheck %s -check-prefix=FIELD45 46// FIELD: Keyword: "int" [2:3 - 2:6] FieldDecl=z:2:7 (Definition)47// FIELD: Identifier: "z" [2:7 - 2:8] FieldDecl=z:2:7 (Definition)48// FIELD: Punctuation: ";" [2:8 - 2:9] StructDecl=Vector:13:9 (Definition)49// FIELD: Keyword: "int" [3:3 - 3:6] FieldDecl=w:3:7 (Definition)50// FIELD: Identifier: "w" [3:7 - 3:8] FieldDecl=w:3:7 (Definition)51// FIELD: Punctuation: ";" [3:8 - 3:9] StructDecl=Vector:13:9 (Definition)52 53// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%S/targeted-nested1.h:1:1:3:1 %s -include %t.h \54// RUN:    -Xclang -error-on-deserialized-decl=TopVar  \55// RUN:  | FileCheck %s -check-prefix=NESTED56 57// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \58// RUN:   c-index-test -test-annotate-tokens=%S/targeted-nested1.h:1:1:3:1 %s -include %t.h \59// RUN:    -Xclang -error-on-deserialized-decl=PreambleVar  \60// RUN:    -Xclang -error-on-deserialized-decl=TopVar  \61// RUN:  | FileCheck %s -check-prefix=NESTED62 63// NESTED: Keyword: "extern" [2:1 - 2:7]64// NESTED: Keyword: "int" [2:8 - 2:11] VarDecl=NestedVar1:2:1265// NESTED: Identifier: "NestedVar1" [2:12 - 2:22] VarDecl=NestedVar1:2:1266// NESTED: Punctuation: ";" [2:22 - 2:23]67 68// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%S/targeted-top.h:1:1:12:1 %s -include %t.h \69// RUN:    -Xclang -error-on-deserialized-decl=NestedVar1  \70// RUN:    -Xclang -error-on-deserialized-decl=vector_get_x  \71// RUN:  | FileCheck %s -check-prefix=TOP72 73// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \74// RUN:   c-index-test -test-annotate-tokens=%S/targeted-top.h:1:1:12:1 %s -include %t.h \75// RUN:    -Xclang -error-on-deserialized-decl=PreambleVar  \76// RUN:    -Xclang -error-on-deserialized-decl=NestedVar1  \77// RUN:    -Xclang -error-on-deserialized-decl=vector_get_x  \78// RUN:  | FileCheck %s -check-prefix=TOP79 80// TOP: Punctuation: "#" [2:1 - 2:2] preprocessing directive=81// TOP: Identifier: "ifndef" [2:2 - 2:8] preprocessing directive=82// TOP: Identifier: "TARGETED_TOP_H" [2:9 - 2:23] preprocessing directive=83// TOP: Punctuation: "#" [3:1 - 3:2] preprocessing directive=84// TOP: Identifier: "define" [3:2 - 3:8] preprocessing directive=85// TOP: Identifier: "TARGETED_TOP_H" [3:9 - 3:23] macro definition=TARGETED_TOP_H86// TOP: Punctuation: "#" [5:1 - 5:2] inclusion directive=targeted-nested1.h87// TOP: Identifier: "include" [5:2 - 5:9] inclusion directive=targeted-nested1.h88// TOP: Literal: ""targeted-nested1.h"" [5:10 - 5:30] inclusion directive=targeted-nested1.h89// TOP: Keyword: "enum" [7:1 - 7:5] EnumDecl=enum (unnamed at {{.*}}):7:1 (Definition)90// TOP: Punctuation: "{" [7:6 - 7:7] EnumDecl=enum (unnamed at {{.*}}):7:1 (Definition)91// TOP: Identifier: "VALUE" [8:3 - 8:8] EnumConstantDecl=VALUE:8:3 (Definition)92// TOP: Punctuation: "=" [8:9 - 8:10] EnumConstantDecl=VALUE:8:3 (Definition)93// TOP: Literal: "3" [8:11 - 8:12] IntegerLiteral=94// TOP: Punctuation: "}" [9:1 - 9:2] EnumDecl=enum (unnamed at {{.*}}):7:1 (Definition)95// TOP: Punctuation: ";" [9:2 - 9:3]96// TOP: Keyword: "extern" [11:1 - 11:7]97// TOP: Keyword: "int" [11:8 - 11:11] VarDecl=TopVar:11:1298// TOP: Identifier: "TopVar" [11:12 - 11:18] VarDecl=TopVar:11:1299// TOP: Punctuation: ";" [11:18 - 11:19]100