Skip to content

Commit f2bf133

Browse files
committed
[unittests] Fix ReparseWorkingDirTest for Windows
1 parent d177a53 commit f2bf133

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

clang/unittests/Frontend/ReparseWorkingDirTest.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ class ReparseWorkingDirTest : public ::testing::Test {
7777
};
7878

7979
TEST_F(ReparseWorkingDirTest, ReparseWorkingDir) {
80-
// Setup the working directory path. We use '//root/' to allow the path to be
81-
// valid on both Windows and Unix. We need the trailing slash for the path
82-
// to be treated as absolute.
80+
// Setup the working directory path.
8381
SmallString<16> WorkingDir;
84-
llvm::sys::path::append(WorkingDir, "//root",
85-
llvm::sys::path::get_separator());
82+
#ifdef _WIN32
83+
WorkingDir = "C:\\";
84+
#else
85+
WorkingDir = "/";
86+
#endif
87+
llvm::sys::path::append(WorkingDir, "root");
8688
setWorkingDirectory(WorkingDir);
8789

8890
SmallString<32> Header;

0 commit comments

Comments
 (0)