56 lines · plain
1// This test checks that we're reporting module maps affecting the compilation by describing excluded headers.2 3// RUN: rm -rf %t4// RUN: split-file %s %t5 6//--- frameworks/X.framework/Modules/module.modulemap7framework module X {8 umbrella header "X.h"9 exclude header "Excluded.h"10}11//--- frameworks/X.framework/Headers/X.h12//--- frameworks/X.framework/Headers/Excluded.h13 14//--- mod/module.modulemap15module Mod { header "Mod.h" }16//--- mod/Mod.h17#include <X/Excluded.h>18 19//--- tu.m20@import Mod;21 22//--- cdb.json.template23[{24 "file": "DIR/tu.m",25 "directory": "DIR",26 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -I DIR/mod -F DIR/frameworks -Werror=non-modular-include-in-module -c DIR/tu.m -o DIR/tu.m"27}]28 29// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json30// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json31// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t32 33// CHECK: {34// CHECK-NEXT: "modules": [35// CHECK-NEXT: {36// CHECK-NEXT: "clang-module-deps": [],37// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/mod/module.modulemap",38// CHECK-NEXT: "command-line": [39// CHECK: "-fmodule-map-file=[[PREFIX]]/frameworks/X.framework/Modules/module.modulemap"40// CHECK-NOT: "-fmodule-file={{.*}}"41// CHECK: ],42// CHECK-NEXT: "context-hash": "{{.*}}",43// CHECK-NEXT: "file-deps": [44// CHECK: ],45// CHECK-NEXT: "link-libraries": [],46// CHECK-NEXT: "name": "Mod"47// CHECK-NEXT: }48// CHECK-NEXT: ]49// CHECK: }50 51// RUN: %deps-to-rsp %t/result.json --module-name=Mod > %t/Mod.cc1.rsp52// RUN: %deps-to-rsp %t/result.json --tu-index=0 > %t/tu.rsp53 54// RUN: %clang @%t/Mod.cc1.rsp55// RUN: %clang @%t/tu.rsp56