aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorSunil Srivastava <sunil_srivastava@playstation.sony.com>2019-03-14 19:26:04 +0000
committerSunil Srivastava <sunil_srivastava@playstation.sony.com>2019-03-14 19:26:04 +0000
commit6823c823d198b60f6590f5348d5a57b3e96c57ad (patch)
treeff1c53e0631c089d0ebd24bd36fc1431d1d4dfde /llvm/unittests/Support/CommandLineTest.cpp
parentde1d5d3675992a60c95b17d70ea817468883c485 (diff)
downloadllvm-6823c823d198b60f6590f5348d5a57b3e96c57ad.zip
llvm-6823c823d198b60f6590f5348d5a57b3e96c57ad.tar.gz
llvm-6823c823d198b60f6590f5348d5a57b3e96c57ad.tar.bz2
Handle consecutive-double-quotes in Windows argument parsing
Windows command line argument processing treats consecutive double quotes as a single double-quote. This patch implements this functionality. Differential Revision: https://reviews.llvm.org/D58662 llvm-svn: 356193
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 4bfa8a3..a7aee41 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -185,7 +185,7 @@ TEST(CommandLineTest, TokenizeGNUCommandLine) {
array_lengthof(Output));
}
-TEST(CommandLineTest, TokenizeWindowsCommandLine) {
+TEST(CommandLineTest, TokenizeWindowsCommandLine1) {
const char Input[] = "a\\b c\\\\d e\\\\\"f g\" h\\\"i j\\\\\\\"k \"lmn\" o pqr "
"\"st \\\"u\" \\v";
const char *const Output[] = { "a\\b", "c\\\\d", "e\\f g", "h\"i", "j\\\"k",
@@ -194,6 +194,13 @@ TEST(CommandLineTest, TokenizeWindowsCommandLine) {
array_lengthof(Output));
}
+TEST(CommandLineTest, TokenizeWindowsCommandLine2) {
+ const char Input[] = "clang -c -DFOO=\"\"\"ABC\"\"\" x.cpp";
+ const char *const Output[] = { "clang", "-c", "-DFOO=\"ABC\"", "x.cpp"};
+ testCommandLineTokenizer(cl::TokenizeWindowsCommandLine, Input, Output,
+ array_lengthof(Output));
+}
+
TEST(CommandLineTest, TokenizeConfigFile1) {
const char *Input = "\\";
const char *const Output[] = { "\\" };