1 // Check that the path of an imported modulemap file is not influenced by
2 // modules outside that module's dependency graph. Specifically, the "Foo"
3 // module below does not transitively import Mod via a symlink, so it should not
4 // see the symlinked path.
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 module %t/include/symlink-to-module
13 // RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 \
14 // RUN: -format experimental-full -mode=preprocess-dependency-directives \
15 // RUN: -optimize-args=all -module-files-dir %t/build > %t/deps.json
17 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
19 // CHECK: "modules": [
21 // CHECK: "command-line": [
23 // CHECK: "-fmodule-map-file=[[PREFIX]]/include/module/module.modulemap"
25 // CHECK: "name": "Foo"
31 "command": "clang -fsyntax-only DIR/test.c -F DIR/Frameworks -I DIR/include -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/module-cache",
35 //--- include/module/module.modulemap
36 module Mod
{ header
"mod.h" export
* }
38 //--- include/module/mod.h
40 //--- include/module.modulemap
41 module Other
{ header
"other.h" export
* }
44 #include "symlink-to-module/mod.h"
45 #include "module/mod.h"
47 //--- Frameworks/Foo.framework/Modules/module.modulemap
48 framework module Foo
{ header
"Foo.h" export
* }
49 //--- Frameworks/Foo.framework/Modules/module.private.modulemap
50 framework module Foo_Private
{ header
"Priv.h" export
* }
52 //--- Frameworks/Foo.framework/Headers/Foo.h
53 #include "module/mod.h"
55 //--- Frameworks/Foo.framework/PrivateHeaders/Priv.h
59 //--- module.modulemap
60 module Test
{ header
"test.h" export
* }