3 // RUN: mkdir %t/Inputs
4 // RUN: cp -R %S/Inputs/frameworks %t/Inputs/frameworks
5 // RUN: split-file %s %t
8 module root
{ header
"root.h" }
9 module direct
{ header
"direct.h" }
12 link framework
"libTransitive"
16 #include "root/textual.h"
17 #include "Framework/Framework.h"
19 #include "transitive.h"
24 // This is here to verify that the "root" directory doesn't clash with name of
27 //--- cdb.json.template
31 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -FDIR/Inputs/frameworks -I DIR -x c"
34 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
35 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -module-name=root > %t/result.json
36 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
39 // CHECK-NEXT: "modules": [
41 // CHECK-NEXT: "clang-module-deps": [],
42 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/Inputs/frameworks/module.modulemap",
43 // CHECK-NEXT: "command-line": [
45 // CHECK-NEXT: "context-hash": "{{.*}}",
46 // CHECK-NEXT: "file-deps": [
47 // CHECK-NEXT: "[[PREFIX]]/Inputs/frameworks/module.modulemap",
48 // CHECK-NEXT: "[[PREFIX]]/Inputs/frameworks/Framework.framework/Headers/Framework.h"
50 // CHECK-NEXT: "link-libraries": [
52 // CHECK-NEXT: "isFramework": true,
53 // CHECK-NEXT: "link-name": "Framework"
56 // CHECK-NEXT: "name": "Framework"
59 // CHECK-NEXT: "clang-module-deps": [
61 // CHECK-NEXT: "context-hash": "{{.*}}",
62 // CHECK-NEXT: "module-name": "transitive"
65 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
66 // CHECK-NEXT: "command-line": [
68 // CHECK-NEXT: "context-hash": "{{.*}}",
69 // CHECK-NEXT: "file-deps": [
70 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
71 // CHECK-NEXT: "[[PREFIX]]/direct.h"
73 // CHECK-NEXT: "link-libraries": [],
74 // CHECK-NEXT: "name": "direct"
77 // CHECK-NEXT: "clang-module-deps": [
79 // CHECK-NEXT: "context-hash": "{{.*}}",
80 // CHECK-NEXT: "module-name": "Framework"
83 // CHECK-NEXT: "context-hash": "{{.*}}",
84 // CHECK-NEXT: "module-name": "direct"
87 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
88 // CHECK-NEXT: "command-line": [
90 // CHECK-NEXT: "context-hash": "{{.*}}",
91 // CHECK-NEXT: "file-deps": [
92 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
93 // CHECK-NEXT: "[[PREFIX]]/root.h",
94 // CHECK-NEXT: "[[PREFIX]]/root/textual.h",
95 // CHECK-NEXT: "[[PREFIX]]/Inputs/frameworks/module.modulemap"
97 // CHECK-NEXT: "link-libraries": [],
98 // CHECK-NEXT: "name": "root"
101 // CHECK-NEXT: "clang-module-deps": [],
102 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
103 // CHECK-NEXT: "command-line": [
105 // CHECK-NEXT: "context-hash": "{{.*}}",
106 // CHECK-NEXT: "file-deps": [
107 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
108 // CHECK-NEXT: "[[PREFIX]]/transitive.h"
110 // CHECK-NEXT: "link-libraries": [
112 // CHECK-NEXT: "isFramework": true,
113 // CHECK-NEXT: "link-name": "libTransitive"
116 // CHECK-NEXT: "name": "transitive"
119 // CHECK-NEXT: "translation-units": []