1 // This test checks that we don't report non-affecting system module maps.
2 // More specifically, we check that explicitly-specified module map file is not
3 // being shadowed in explicit build by a module map file found during implicit
7 // RUN: split-file %s %t
12 //--- zeroth/module.modulemap
15 //--- first/module.modulemap
16 module first { header "first.h" }
19 //--- second/module.modulemap
21 //--- third/module.modulemap
24 //--- cdb.json.template
28 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -fmodule-name=X -fmodule-map-file=DIR/zeroth/module.modulemap -isystem DIR/first -isystem DIR/second -isystem DIR/third -c DIR/tu.m -o DIR/tu.o"
31 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
32 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json
33 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
35 // CHECK-NEXT: "modules": [
37 // CHECK-NEXT: "clang-module-deps": [
39 // CHECK-NEXT: "context-hash": "{{.*}}",
40 // CHECK-NEXT: "module-name": "third"
43 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/first/module.modulemap",
44 // CHECK-NEXT: "command-line": [
46 // CHECK-NEXT: "context-hash": "{{.*}}",
47 // CHECK-NEXT: "file-deps": [
48 // CHECK-NEXT: [[PREFIX]]/first/module.modulemap",
49 // CHECK-NEXT: [[PREFIX]]/first/first.h",
50 // CHECK-NEXT: [[PREFIX]]/third/module.modulemap"
52 // CHECK-NEXT: "link-libraries": [],
53 // CHECK-NEXT: "name": "first"
58 // RUN: %deps-to-rsp %t/result.json --module-name=third > %t/third.cc1.rsp
59 // RUN: %deps-to-rsp %t/result.json --module-name=first > %t/first.cc1.rsp
60 // RUN: %clang @%t/third.cc1.rsp
61 // RUN: %clang @%t/first.cc1.rsp