2 // RUN: split-file %s %t
7 //--- first/module.modulemap
8 module first
{ header
"first.h" }
12 //--- second/module.modulemap
13 module second
{ header
"second.h" }
17 //--- third/module.modulemap
18 module third
{ header
"third.h" }
22 //--- cdb.json.template
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
34 // CHECK-NEXT: "modules": [
36 // CHECK-NEXT: "clang-module-deps": [
38 // CHECK-NEXT: "context-hash": "{{.*}}",
39 // CHECK-NEXT: "module-name": "second"
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"
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"
55 // CHECK-NEXT: "link-libraries": [],
56 // CHECK-NEXT: "name": "first"