1 // This test checks that we're reporting module maps affecting the compilation by describing excluded headers.
4 // RUN: split-file %s %t
6 //--- frameworks/X.framework/Modules/module.modulemap
9 exclude header "Excluded.h"
11 //--- frameworks/X.framework/Headers/X.h
12 //--- frameworks/X.framework/Headers/Excluded.h
14 //--- mod/module.modulemap
15 module Mod { header "Mod.h" }
17 #include <X/Excluded.h>
22 //--- cdb.json.template
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"
29 // RUN: sed -e "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": [],
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={{.*}}"
42 // CHECK-NEXT: "context-hash": "{{.*}}",
43 // CHECK-NEXT: "file-deps": [
45 // CHECK-NEXT: "name": "Mod"
50 // RUN: %deps-to-rsp %t/result.json --module-name=Mod > %t/Mod.cc1.rsp
51 // RUN: %deps-to-rsp %t/result.json --tu-index=0 > %t/tu.rsp
53 // RUN: %clang @%t/Mod.cc1.rsp
54 // RUN: %clang @%t/tu.rsp