[RISCV] Add shrinkwrap test cases showing gaps in current impl
[llvm-project.git] / clang / test / ClangScanDeps / modules-full-by-mod-name.c
blobc838614d0bfdea0be6f75a571d8533a5349754c3
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
4 //--- module.modulemap
5 module root { header "root.h" }
6 module direct { header "direct.h" }
7 module transitive { header "transitive.h" }
8 //--- root.h
9 #include "direct.h"
10 #include "root/textual.h"
11 //--- direct.h
12 #include "transitive.h"
13 //--- transitive.h
14 // empty
16 //--- root/textual.h
17 // This is here to verify that the "root" directory doesn't clash with name of
18 // the "root" module.
20 //--- cdb.json.template
22 "file": "",
23 "directory": "DIR",
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
31 // CHECK: {
32 // CHECK-NEXT: "modules": [
33 // CHECK-NEXT: {
34 // CHECK-NEXT: "clang-module-deps": [
35 // CHECK-NEXT: {
36 // CHECK-NEXT: "context-hash": "{{.*}}",
37 // CHECK-NEXT: "module-name": "transitive"
38 // CHECK-NEXT: }
39 // CHECK-NEXT: ],
40 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
41 // CHECK-NEXT: "command-line": [
42 // CHECK: ],
43 // CHECK-NEXT: "context-hash": "{{.*}}",
44 // CHECK-NEXT: "file-deps": [
45 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
46 // CHECK-NEXT: "[[PREFIX]]/direct.h"
47 // CHECK-NEXT: ],
48 // CHECK-NEXT: "link-libraries": [],
49 // CHECK-NEXT: "name": "direct"
50 // CHECK-NEXT: },
51 // CHECK-NEXT: {
52 // CHECK-NEXT: "clang-module-deps": [
53 // CHECK-NEXT: {
54 // CHECK-NEXT: "context-hash": "{{.*}}",
55 // CHECK-NEXT: "module-name": "direct"
56 // CHECK-NEXT: }
57 // CHECK-NEXT: ],
58 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
59 // CHECK-NEXT: "command-line": [
60 // CHECK: ],
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"
66 // CHECK-NEXT: ],
67 // CHECK-NEXT: "link-libraries": [],
68 // CHECK-NEXT: "name": "root"
69 // CHECK-NEXT: },
70 // CHECK-NEXT: {
71 // CHECK-NEXT: "clang-module-deps": [],
72 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
73 // CHECK-NEXT: "command-line": [
74 // CHECK: ],
75 // CHECK-NEXT: "context-hash": "{{.*}}",
76 // CHECK-NEXT: "file-deps": [
77 // CHECK-NEXT: "[[PREFIX]]/module.modulemap",
78 // CHECK-NEXT: "[[PREFIX]]/transitive.h"
79 // CHECK-NEXT: ],
80 // CHECK-NEXT: "link-libraries": [],
81 // CHECK-NEXT: "name": "transitive"
82 // CHECK-NEXT: }
83 // CHECK-NEXT: ],
84 // CHECK-NEXT: "translation-units": []
85 // CHECK-NEXT: }