Index: test/Modules/Inputs/relative-module-paths/a.h =================================================================== --- /dev/null +++ test/Modules/Inputs/relative-module-paths/a.h @@ -0,0 +1,7 @@ +#ifndef A_H +#define A_H + +void a() { +} + +#endif Index: test/Modules/Inputs/relative-module-paths/b.h =================================================================== --- /dev/null +++ test/Modules/Inputs/relative-module-paths/b.h @@ -0,0 +1,10 @@ +#ifndef B_H +#define B_H + +#include "a.h" + +void b() { + a(); +} + +#endif Index: test/Modules/Inputs/relative-module-paths/module.map =================================================================== --- /dev/null +++ test/Modules/Inputs/relative-module-paths/module.map @@ -0,0 +1,12 @@ +module "a" { + export * + header "Inputs/relative-module-paths/a.h" +} + +module "b" { + export * + header "Inputs/relative-module-paths/b.h" + use "a" +} + + Index: test/Modules/relative-module-paths.cpp =================================================================== --- /dev/null +++ test/Modules/relative-module-paths.cpp @@ -0,0 +1,34 @@ +// RQUIRES: shell +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: cd %t +// RUN: ln -s %S/Inputs Inputs + +// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fmodule-name=a -o a.pcm \ +// RUN: -fno-implicit-modules -fmodule-map-file-home-is-cwd \ +// RUN: -emit-module Inputs/relative-module-paths/module.map + +// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fmodule-name=b -o b.pcm \ +// RUN: -fmodule-file=a.pcm \ +// RUN: -fno-implicit-modules -fmodule-map-file-home-is-cwd \ +// RUN: -emit-module Inputs/relative-module-paths/module.map + +// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules %s \ +// RUN: -fmodule-map-file=Inputs/relative-module-paths/module.map \ +// RUN: -fmodule-file=b.pcm \ +// RUN: -fno-implicit-modules -fmodule-map-file-home-is-cwd \ +// RUN: -module-file-deps -MT %s.o -dependency-file deps + +// RUN: cat deps +// RUN: FileCheck %s < %t/deps + +#include "Inputs/relative-module-paths/a.h" + +void f() { + a(); +} + +// CHECK: Hah + + +