summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Lex/HeaderSearchTest.cpp
diff options
context:
space:
mode:
authorKadir Cetinkaya <kadircet@google.com>2019-04-24 08:45:03 +0000
committerKadir Cetinkaya <kadircet@google.com>2019-04-24 08:45:03 +0000
commit40f8f7f95c1b200117981b231b9a1902b31ea9a8 (patch)
treeef440d86a9f6a308cc757b1a4c4b7007b47cb4b4 /clang/unittests/Lex/HeaderSearchTest.cpp
parent2f66b256480f0deccdeef17d0a7b82d5d971c094 (diff)
downloadbcm5719-llvm-40f8f7f95c1b200117981b231b9a1902b31ea9a8.tar.gz
bcm5719-llvm-40f8f7f95c1b200117981b231b9a1902b31ea9a8.zip
[clang][HeaderSearch] Make sure there are no backslashes in suggestedPath
Reviewers: sammccall Differential Revision: https://reviews.llvm.org/D60995 llvm-svn: 359075
Diffstat (limited to 'clang/unittests/Lex/HeaderSearchTest.cpp')
-rw-r--r--clang/unittests/Lex/HeaderSearchTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Lex/HeaderSearchTest.cpp b/clang/unittests/Lex/HeaderSearchTest.cpp
index 6365d3ed057..b5b0f9a833c 100644
--- a/clang/unittests/Lex/HeaderSearchTest.cpp
+++ b/clang/unittests/Lex/HeaderSearchTest.cpp
@@ -91,5 +91,14 @@ TEST_F(HeaderSearchTest, Dots) {
"z");
}
+#ifdef _WIN32
+TEST_F(HeaderSearchTest, BackSlash) {
+ addSearchDir("C:\\x\\y\\");
+ EXPECT_EQ(Search.suggestPathToFileForDiagnostics("C:\\x\\y\\z\\t",
+ /*WorkingDir=*/""),
+ "z/t");
+}
+#endif
+
} // namespace
} // namespace clang
OpenPOWER on IntegriCloud