62 lines · plain
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 not3// being shadowed in explicit build by a module map file found during implicit4// module map search.5 6// RUN: rm -rf %t7// RUN: split-file %s %t8 9//--- tu.m10@import first;11 12//--- zeroth/module.modulemap13module X {}14 15//--- first/module.modulemap16module first { header "first.h" }17//--- first/first.h18@import third;19//--- second/module.modulemap20module X {}21//--- third/module.modulemap22module third {}23 24//--- cdb.json.template25[{26 "file": "DIR/tu.m",27 "directory": "DIR",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"29}]30 31// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json32// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json33// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t34// CHECK: {35// CHECK-NEXT: "modules": [36// CHECK-NEXT: {37// CHECK-NEXT: "clang-module-deps": [38// CHECK-NEXT: {39// CHECK-NEXT: "context-hash": "{{.*}}",40// CHECK-NEXT: "module-name": "third"41// CHECK-NEXT: }42// CHECK-NEXT: ],43// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/first/module.modulemap",44// CHECK-NEXT: "command-line": [45// CHECK: ],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"51// CHECK-NEXT: ],52// CHECK-NEXT: "link-libraries": [],53// CHECK-NEXT: "name": "first"54// CHECK-NEXT: }55// CHECK: ]56// CHECK: }57 58// RUN: %deps-to-rsp %t/result.json --module-name=third > %t/third.cc1.rsp59// RUN: %deps-to-rsp %t/result.json --module-name=first > %t/first.cc1.rsp60// RUN: %clang @%t/third.cc1.rsp61// RUN: %clang @%t/first.cc1.rsp62