Index: lib/Format/Format.cpp =================================================================== --- lib/Format/Format.cpp +++ lib/Format/Format.cpp @@ -1917,7 +1917,10 @@ // Look for .clang-format/_clang-format file in the file's parent directories. SmallString<128> UnsuitableConfigFiles; SmallString<128> Path(FileName); - llvm::sys::fs::make_absolute(Path); + std::error_code EC = FS->makeAbsolute(Path); + assert(!EC); + (void)EC; + for (StringRef Directory = Path; !Directory.empty(); Directory = llvm::sys::path::parent_path(Directory)) { Index: unittests/Format/FormatTest.cpp =================================================================== --- unittests/Format/FormatTest.cpp +++ unittests/Format/FormatTest.cpp @@ -10907,10 +10907,6 @@ format("auto a = unique_ptr < Foo < Bar>[10]> ;", Spaces)); } -// Since this test case uses UNIX-style file path. We disable it for MS -// compiler. -#if !defined(_MSC_VER) && !defined(__MINGW32__) - TEST(FormatStyle, GetStyleOfFile) { vfs::InMemoryFileSystem FS; // Test 1: format file in the same directory. @@ -10938,8 +10934,6 @@ ASSERT_EQ(Style3, getGoogleStyle()); } -#endif // _MSC_VER - TEST_F(ReplacementTest, FormatCodeAfterReplacements) { // Column limit is 20. std::string Code = "Type *a =\n"