[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ClangScanDeps / modules-file-path-isolation.c
blob0e55bba75384163e0216f56a441ceed7ad09c3ec
1 // Ensure that the spelling of a path seen outside a module (e.g. header via
2 // symlink) does not leak into the compilation of that module unnecessarily.
3 // Note: the spelling of the modulemap path still depends on the includer, since
4 // that is the only source of information about it.
6 // REQUIRES: shell
8 // RUN: rm -rf %t
9 // RUN: split-file %s %t
10 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json
11 // RUN: ln -s A.h %t/Z.h
13 // RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 -format experimental-full \
14 // RUN: -mode preprocess-dependency-directives > %t/output
15 // RUN: FileCheck %s < %t/output
17 // CHECK: "modules": [
18 // CHECK-NEXT: {
19 // CHECK: "file-deps": [
20 // CHECK-NEXT: "{{.*}}A.h",
21 // CHECK-NEXT: "{{.*}}module.modulemap"
22 // CHECK-NEXT: ],
23 // CHECK-NEXT: "name": "A"
24 // CHECK-NEXT: }
26 //--- cdb.json.in
28 "directory": "DIR",
29 "command": "clang -fsyntax-only DIR/tu.c -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps",
30 "file": "DIR/tu.c"
33 //--- module.modulemap
34 module A { header "A.h" }
35 module B { header "B.h" }
36 module C { header "C.h" }
38 //--- A.h
40 //--- B.h
41 #include "Z.h"
43 //--- tu.c
44 #include "B.h"