2 // RUN: split-file %s %t
5 module root
{ header
"root.h" }
6 module direct
{ header
"direct.h" }
7 module transitive
{ header
"transitive.h" }
10 #include "root/textual.h"
12 #include "transitive.h"
17 // This is here to verify that the "root" directory doesn't clash with name of
20 //--- cdb.json.template
24 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -I DIR -x c"
27 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
28 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -module-name=root > %t/result.json
29 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
32 // CHECK-NEXT: "modules": [
34 // CHECK-NEXT: "clang-module-deps": [
36 // CHECK-NEXT: "context-hash": "{{.*}}",
37 // CHECK-NEXT: "module-name": "transitive"
40 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
41 // CHECK-NEXT: "command-line": [
43 // CHECK-NEXT: "context-hash": "{{.*}}",
44 // CHECK-NEXT: "file-deps": [
45 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
46 // CHECK-NEXT: "[[PREFIX]]/direct.h"
48 // CHECK-NEXT: "link-libraries": [],
49 // CHECK-NEXT: "name": "direct"
52 // CHECK-NEXT: "clang-module-deps": [
54 // CHECK-NEXT: "context-hash": "{{.*}}",
55 // CHECK-NEXT: "module-name": "direct"
58 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
59 // CHECK-NEXT: "command-line": [
61 // CHECK-NEXT: "context-hash": "{{.*}}",
62 // CHECK-NEXT: "file-deps": [
63 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
64 // CHECK-NEXT: "[[PREFIX]]/root.h",
65 // CHECK-NEXT: "[[PREFIX]]/root/textual.h"
67 // CHECK-NEXT: "link-libraries": [],
68 // CHECK-NEXT: "name": "root"
71 // CHECK-NEXT: "clang-module-deps": [],
72 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
73 // CHECK-NEXT: "command-line": [
75 // CHECK-NEXT: "context-hash": "{{.*}}",
76 // CHECK-NEXT: "file-deps": [
77 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
78 // CHECK-NEXT: "[[PREFIX]]/transitive.h"
80 // CHECK-NEXT: "link-libraries": [],
81 // CHECK-NEXT: "name": "transitive"
84 // CHECK-NEXT: "translation-units": []