[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / ClangScanDeps / modules-transitive.c
blob1a3b8a367118150b4867ca2d42ecd04d4c5fc71d
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
4 //--- tu.m
5 #include "first.h"
7 //--- first/module.modulemap
8 module first { header "first.h" }
9 //--- first/first.h
10 #include "second.h"
12 //--- second/module.modulemap
13 module second { header "second.h" }
14 //--- second/second.h
15 #include "third.h"
17 //--- third/module.modulemap
18 module third { header "third.h" }
19 //--- third/third.h
20 // empty
22 //--- cdb.json.template
24 "file": "DIR/tu.c",
25 "directory": "DIR",
26 "command": "clang -I DIR/first -I DIR/second -I DIR/third -fmodules -fmodules-cache-path=DIR/cache -c DIR/tu.m -o DIR/tu.o"
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 > %t/result.json
31 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
33 // CHECK: {
34 // CHECK-NEXT: "modules": [
35 // CHECK-NEXT: {
36 // CHECK-NEXT: "clang-module-deps": [
37 // CHECK-NEXT: {
38 // CHECK-NEXT: "context-hash": "{{.*}}",
39 // CHECK-NEXT: "module-name": "second"
40 // CHECK-NEXT: }
41 // CHECK-NEXT: ],
42 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/first/module.modulemap",
43 // CHECK-NEXT: "command-line": [
44 // CHECK-NEXT: "-cc1",
45 // CHECK-NOT: "-fmodule-map-file=[[PREFIX]]/third/module.modulemap"
46 // CHECK: "-fmodule-map-file=[[PREFIX]]/second/module.modulemap"
47 // CHECK-NOT: "-fmodule-map-file=[[PREFIX]]/third/module.modulemap"
48 // CHECK: ],
49 // CHECK-NEXT: "context-hash": "{{.*}}",
50 // CHECK-NEXT: "file-deps": [
51 // CHECK-NEXT: "[[PREFIX]]/first/module.modulemap",
52 // CHECK-NEXT: "[[PREFIX]]/first/first.h",
53 // CHECK-NEXT: "[[PREFIX]]/second/module.modulemap"
54 // CHECK-NEXT: ],
55 // CHECK-NEXT: "link-libraries": [],
56 // CHECK-NEXT: "name": "first"
57 // CHECK-NEXT: }
58 // CHECK: ]
59 // CHECK: }