1 // Check that unused directly passed -fmodule-map-file options get dropped.
3 // RUN: rm -rf %t && split-file %s %t
4 // RUN: sed -e "s|DIR|%/t|g" %t/build/cdb.json.in > %t/build/cdb.json
5 // RUN: clang-scan-deps -compilation-database %t/build/cdb.json \
6 // RUN: -format experimental-full > %t/deps.json
7 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
10 // CHECK-NEXT: "modules": [
12 // CHECK-NEXT: "clang-module-deps": [
14 // CHECK-NEXT: "context-hash": "{{.*}}",
15 // CHECK-NEXT: "module-name": "B"
18 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/modules/A/module.modulemap",
19 // CHECK-NEXT: "command-line": [
20 // CHECK-NOT: "-fmodule-map-file=[[PREFIX]]/modules/A/module.modulemap"
21 // CHECK: "-fmodule-map-file=[[PREFIX]]/modules/B/module.modulemap"
22 // CHECK-NOT: "-fmodule-map-file=[[PREFIX]]/modules/A/module.modulemap"
24 // CHECK-NEXT: "context-hash": "{{.*}}",
25 // CHECK-NEXT: "file-deps": [
27 // CHECK-NEXT: "link-libraries": [],
28 // CHECK-NEXT: "name": "A"
31 // CHECK-NEXT: "clang-module-deps": [],
32 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/modules/B/module.modulemap",
33 // CHECK-NEXT: "command-line": [
34 // CHECK-NOT: "-fmodule-map-file=
36 // CHECK-NEXT: "context-hash": "{{.*}}",
37 // CHECK-NEXT: "file-deps": [
39 // CHECK-NEXT: "link-libraries": [],
40 // CHECK-NEXT: "name": "B"
43 // CHECK-NEXT: "translation-units": [
47 //--- build/cdb.json.in
50 "command": "clang -c DIR/tu.m -I DIR/modules/B -fmodule-map-file=DIR/modules/A/module.modulemap -fmodules -fmodules-cache-path=DIR/cache -fimplicit-module-maps",
54 //--- build/vfs.yaml.in
59 //--- modules/A/module.modulemap
60 module A { header "A.h" }
65 //--- modules/B/module.modulemap
66 module B { header "B.h" }