summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support')
-rw-r--r--llvm/unittests/Support/Path.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 65bd1de8b70..7ddc5dbb396 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -969,6 +969,8 @@ TEST(Support, RemoveDots) {
EXPECT_EQ("c", remove_dots(".\\.\\c", true));
EXPECT_EQ("..\\a\\c", remove_dots("..\\a\\b\\..\\c", true));
EXPECT_EQ("..\\..\\a\\c", remove_dots("..\\..\\a\\b\\..\\c", true));
+ EXPECT_EQ("\\a\\c", remove_dots("\\..\\..\\a\\c", true));
+ EXPECT_EQ("\\a\\c", remove_dots("\\..\\a\\b\\\\..\\.\\.\\\\c", true));
SmallString<64> Path1(".\\.\\c");
EXPECT_TRUE(path::remove_dots(Path1, true));
@@ -982,6 +984,8 @@ TEST(Support, RemoveDots) {
EXPECT_EQ("c", remove_dots("././c", true));
EXPECT_EQ("../a/c", remove_dots("../a/b/../c", true));
EXPECT_EQ("../../a/c", remove_dots("../../a/b/../c", true));
+ EXPECT_EQ("/a/c", remove_dots("/../../a/c", true));
+ EXPECT_EQ("/a/c", remove_dots("/../a/b//../././/c", true));
SmallString<64> Path1("././c");
EXPECT_TRUE(path::remove_dots(Path1, true));
OpenPOWER on IntegriCloud