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]]/direct.h"
46 // CHECK-NEXT: "[[PREFIX]]/module.modulemap"
48 // CHECK-NEXT: "name": "direct"
51 // CHECK-NEXT: "clang-module-deps": [
53 // CHECK-NEXT: "context-hash": "{{.*}}",
54 // CHECK-NEXT: "module-name": "direct"
57 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
58 // CHECK-NEXT: "command-line": [
60 // CHECK-NEXT: "context-hash": "{{.*}}",
61 // CHECK-NEXT: "file-deps": [
62 // CHECK-NEXT: "[[PREFIX]]/module.modulemap"
63 // CHECK-NEXT: "[[PREFIX]]/root.h"
64 // CHECK-NEXT: "[[PREFIX]]/root/textual.h"
66 // CHECK-NEXT: "name": "root"
69 // CHECK-NEXT: "clang-module-deps": [],
70 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
71 // CHECK-NEXT: "command-line": [
73 // CHECK-NEXT: "context-hash": "{{.*}}",
74 // CHECK-NEXT: "file-deps": [
75 // CHECK-NEXT: "[[PREFIX]]/module.modulemap"
76 // CHECK-NEXT: "[[PREFIX]]/transitive.h"
78 // CHECK-NEXT: "name": "transitive"
81 // CHECK-NEXT: "translation-units": []