Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -394,6 +394,16 @@ if (llvm::sys::fs::exists(P)) { FoundPCH = UsePCH; FoundPTH = !UsePCH; + } else { + for (const Arg *A : Args.filtered(options::OPT_I_Group)) { + SmallString<128> Path(A->getValue()); + llvm::sys::path::append(Path, P); + if (llvm::sys::fs::exists(Path)) { + P = Path; + FoundPCH = UsePCH; + FoundPTH = !UsePCH; + } + } } }