diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -1893,6 +1893,7 @@ const LangOptions &LangOpts, const TargetInfo &TI) { LangOpts.remapPathPrefix(Path); + llvm::sys::path::remove_dots(Path); if (LangOpts.UseTargetPathSeparator) { if (TI.getTriple().isOSWindows()) llvm::sys::path::make_preferred( diff --git a/clang/test/Modules/filename.cpp b/clang/test/Modules/filename.cpp --- a/clang/test/Modules/filename.cpp +++ b/clang/test/Modules/filename.cpp @@ -5,4 +5,4 @@ // Make sure that headers that are referenced by module maps have __FILE__ // reflect the include path they were found with. -// CHECK: const char *p = "./Inputs/filename/a.h" +// CHECK: const char *p = "Inputs/filename/a.h"