aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Basic/FileManagerTest.cpp
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2022-06-02 10:30:24 -0700
committerReid Kleckner <rnk@google.com>2022-06-02 11:07:44 -0700
commit35ab2a11bb55c39ef9fe389aeacc14bb55c5a12d (patch)
treeca1c351b0e8af4fea1547b6531824c19da711da9 /clang/unittests/Basic/FileManagerTest.cpp
parente4870c835791faa7b71f66820fdb6bcdcec636d7 (diff)
downloadllvm-35ab2a11bb55c39ef9fe389aeacc14bb55c5a12d.zip
llvm-35ab2a11bb55c39ef9fe389aeacc14bb55c5a12d.tar.gz
llvm-35ab2a11bb55c39ef9fe389aeacc14bb55c5a12d.tar.bz2
Fix a buglet in remove_dots().
The function promises to canonicalize the path, but neglected to do so for the root component. For example, calling remove_dots("/tmp/foo.c", Style::windows_backslash) resulted in "/tmp\foo.c". Now it produces "\tmp\foo.c". Also fix FIXME in the corresponding test. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D126412
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
-rw-r--r--clang/unittests/Basic/FileManagerTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp
index b8b12a9..535d4d9 100644
--- a/clang/unittests/Basic/FileManagerTest.cpp
+++ b/clang/unittests/Basic/FileManagerTest.cpp
@@ -411,7 +411,7 @@ TEST_F(FileManagerTest, getVirtualFileWithDifferentName) {
#endif // !_WIN32
static StringRef getSystemRoot() {
- return is_style_windows(llvm::sys::path::Style::native) ? "C:/" : "/";
+ return is_style_windows(llvm::sys::path::Style::native) ? "C:\\" : "/";
}
TEST_F(FileManagerTest, makeAbsoluteUsesVFS) {