1f4a2713aSLionel Sambuc 2f4a2713aSLionel Sambuc#include <DependsOnModule/DependsOnModule.h> 3f4a2713aSLionel Sambuc@import DependsOnModule; 4f4a2713aSLionel Sambucint glob; 5f4a2713aSLionel Sambuc 6f4a2713aSLionel Sambuc// RUN: rm -rf %t.cache 7f4a2713aSLionel Sambuc// RUN: c-index-test -test-annotate-tokens=%s:2:1:5:1 %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ 8f4a2713aSLionel Sambuc// RUN: | FileCheck %s 9f4a2713aSLionel Sambuc 10f4a2713aSLionel Sambuc// CHECK: Punctuation: "#" [2:1 - 2:2] inclusion directive=[[INC_DIR:DependsOnModule[/\\]DependsOnModule\.h \(.*/Modules/Inputs/DependsOnModule\.framework[/\\]Headers[/\\]DependsOnModule.h\)]] 11f4a2713aSLionel Sambuc// CHECK-NEXT: Identifier: "include" [2:2 - 2:9] inclusion directive=[[INC_DIR]] 12f4a2713aSLionel Sambuc// CHECK-NEXT: Punctuation: "<" [2:10 - 2:11] inclusion directive=[[INC_DIR]] 13f4a2713aSLionel Sambuc// CHECK-NEXT: Identifier: "DependsOnModule" [2:11 - 2:26] inclusion directive=[[INC_DIR]] 14f4a2713aSLionel Sambuc// CHECK-NEXT: Punctuation: "/" [2:26 - 2:27] inclusion directive=[[INC_DIR]] 15f4a2713aSLionel Sambuc// CHECK-NEXT: Identifier: "DependsOnModule" [2:27 - 2:42] inclusion directive=[[INC_DIR]] 16f4a2713aSLionel Sambuc// CHECK-NEXT: Punctuation: "." [2:42 - 2:43] inclusion directive=[[INC_DIR]] 17f4a2713aSLionel Sambuc// CHECK-NEXT: Identifier: "h" [2:43 - 2:44] inclusion directive=[[INC_DIR]] 18f4a2713aSLionel Sambuc// CHECK-NEXT: Punctuation: ">" [2:44 - 2:45] inclusion directive=[[INC_DIR]] 19f4a2713aSLionel Sambuc// CHECK-NEXT: Punctuation: "@" [3:1 - 3:2] ModuleImport=DependsOnModule:3:1 20f4a2713aSLionel Sambuc// CHECK-NEXT: Keyword: "import" [3:2 - 3:8] ModuleImport=DependsOnModule:3:1 21f4a2713aSLionel Sambuc// CHECK-NEXT: Identifier: "DependsOnModule" [3:9 - 3:24] ModuleImport=DependsOnModule:3:1 22f4a2713aSLionel Sambuc// CHECK-NEXT: Punctuation: ";" [3:24 - 3:25] 23f4a2713aSLionel Sambuc// CHECK-NEXT: Keyword: "int" [4:1 - 4:4] VarDecl=glob:4:5 24f4a2713aSLionel Sambuc// CHECK-NEXT: Identifier: "glob" [4:5 - 4:9] VarDecl=glob:4:5 25f4a2713aSLionel Sambuc// CHECK-NEXT: Punctuation: ";" [4:9 - 4:10] 26f4a2713aSLionel Sambuc 27f4a2713aSLionel Sambuc// RUN: c-index-test -test-annotate-tokens=%S/../Modules/Inputs/Module.framework/Headers/Sub.h:1:1:3:1 %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ 28f4a2713aSLionel Sambuc// RUN: | FileCheck %s -check-prefix=CHECK-MOD 29f4a2713aSLionel Sambuc 30f4a2713aSLionel Sambuc// CHECK-MOD: Punctuation: "#" [1:1 - 1:2] inclusion directive=[[INC_DIR:Module[/\\]Sub2\.h \(.*/Modules/Inputs/Module\.framework[/\\]Headers[/\\]Sub2.h\)]] 31f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Identifier: "include" [1:2 - 1:9] inclusion directive=[[INC_DIR]] 32f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Punctuation: "<" [1:10 - 1:11] inclusion directive=[[INC_DIR]] 33f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Identifier: "Module" [1:11 - 1:17] inclusion directive=[[INC_DIR]] 34f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Punctuation: "/" [1:17 - 1:18] inclusion directive=[[INC_DIR]] 35f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Identifier: "Sub2" [1:18 - 1:22] inclusion directive=[[INC_DIR]] 36f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Punctuation: "." [1:22 - 1:23] inclusion directive=[[INC_DIR]] 37f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Identifier: "h" [1:23 - 1:24] inclusion directive=[[INC_DIR]] 38f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Punctuation: ">" [1:24 - 1:25] inclusion directive=[[INC_DIR]] 39f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Keyword: "int" [2:1 - 2:4] VarDecl=Module_Sub:2:6 40f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Punctuation: "*" [2:5 - 2:6] VarDecl=Module_Sub:2:6 41f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Identifier: "Module_Sub" [2:6 - 2:16] VarDecl=Module_Sub:2:6 42f4a2713aSLionel Sambuc// CHECK-MOD-NEXT: Punctuation: ";" [2:16 - 2:17] 43f4a2713aSLionel Sambuc 44f4a2713aSLionel Sambuc// RUN: c-index-test -cursor-at=%s:3:11 %s -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ 45f4a2713aSLionel Sambuc// RUN: | FileCheck %s -check-prefix=CHECK-CURSOR 46f4a2713aSLionel Sambuc 47*0a6a1f1dSLionel Sambuc// CHECK-CURSOR: 3:1 ModuleImport=DependsOnModule:3:1 (Definition) Extent=[3:1 - 3:24] Spelling=DependsOnModule ([3:9 - 3:24]) ModuleName=DependsOnModule ({{.*}}DependsOnModule-{{[^.]*}}.pcm) system=0 Headers(2): 48f4a2713aSLionel Sambuc// CHECK-CURSOR-NEXT: {{.*}}other.h 49f4a2713aSLionel Sambuc// CHECK-CURSOR-NEXT: {{.*}}DependsOnModule.h 50