1 // UNSUPPORTED: target=powerpc64-ibm-aix{{.*}}
4 // RUN: split-file %s %t
7 module root
{ header
"root.h" }
8 module direct
{ header
"direct.h" }
9 module transitive
{ header
"transitive.h" }
12 #include "root/textual.h"
14 #include "transitive.h"
19 // This is here to verify that the "root" directory doesn't clash with name of
22 //--- cdb.json.template
26 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -I DIR -x c"
29 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
30 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -module-name=root > %t/result.json
31 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
34 // CHECK-NEXT: "modules": [
36 // CHECK-NEXT: "clang-module-deps": [
38 // CHECK-NEXT: "context-hash": "{{.*}}",
39 // CHECK-NEXT: "module-name": "transitive"
42 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
43 // CHECK-NEXT: "command-line": [
45 // CHECK-NEXT: "context-hash": "{{.*}}",
46 // CHECK-NEXT: "file-deps": [
47 // CHECK-NEXT: "[[PREFIX]]/direct.h"
48 // CHECK-NEXT: "[[PREFIX]]/module.modulemap"
50 // CHECK-NEXT: "name": "direct"
53 // CHECK-NEXT: "clang-module-deps": [
55 // CHECK-NEXT: "context-hash": "{{.*}}",
56 // CHECK-NEXT: "module-name": "direct"
59 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
60 // CHECK-NEXT: "command-line": [
62 // CHECK-NEXT: "context-hash": "{{.*}}",
63 // CHECK-NEXT: "file-deps": [
64 // CHECK-NEXT: "[[PREFIX]]/module.modulemap"
65 // CHECK-NEXT: "[[PREFIX]]/root.h"
66 // CHECK-NEXT: "[[PREFIX]]/root/textual.h"
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: "name": "transitive"
83 // CHECK-NEXT: "translation-units": []