diff options
| author | Rui Ueyama <ruiu@google.com> | 2013-07-29 23:32:22 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2013-07-29 23:32:22 +0000 |
| commit | 85cd10ffa0159f1dd4ba4b5401abb48792ea0ffa (patch) | |
| tree | 91c4619f7ef6204abd64510cd805c0fdca89eeb5 /lld/unittests/DriverTests | |
| parent | 4d3de853a2c944a658d3e8470341da75c217fdaa (diff) | |
| download | bcm5719-llvm-85cd10ffa0159f1dd4ba4b5401abb48792ea0ffa.tar.gz bcm5719-llvm-85cd10ffa0159f1dd4ba4b5401abb48792ea0ffa.zip | |
[PECOFF][Driver] Remove quotes from command line arguments.
The command line option in .drectve section may be quoted by double
quotes, and if that's the case we have to remove them.
llvm-svn: 187390
Diffstat (limited to 'lld/unittests/DriverTests')
| -rw-r--r-- | lld/unittests/DriverTests/WinLinkDriverTest.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lld/unittests/DriverTests/WinLinkDriverTest.cpp b/lld/unittests/DriverTests/WinLinkDriverTest.cpp index d32f22259b4..f4fd29df084 100644 --- a/lld/unittests/DriverTests/WinLinkDriverTest.cpp +++ b/lld/unittests/DriverTests/WinLinkDriverTest.cpp @@ -66,6 +66,16 @@ TEST_F(WinLinkParserTest, UnixStyleOption) { EXPECT_EQ("a.obj", inputFile(0)); } +TEST_F(WinLinkParserTest, Quote) { + EXPECT_FALSE(parse("link.exe", "/subsystem:\"console\"", "-out:'a.exe'", + "/defaultlib:'user32.lib'", "'a.obj'", nullptr)); + EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI, _info.getSubsystem()); + EXPECT_EQ("a.exe", _info.outputPath()); + EXPECT_EQ(2, inputFileCount()); + EXPECT_EQ("a.obj", inputFile(0)); + EXPECT_EQ("user32.lib", inputFile(1)); +} + TEST_F(WinLinkParserTest, Mllvm) { EXPECT_FALSE(parse("link.exe", "-mllvm", "-debug", "a.obj", nullptr)); const std::vector<const char *> &options = _info.llvmOptions(); @@ -205,7 +215,7 @@ TEST_F(WinLinkParserTest, NoInputFiles) { TEST_F(WinLinkParserTest, FailIfMismatch_Match) { EXPECT_FALSE(parse("link.exe", "/failifmismatch:foo=bar", - "/failifmismatch:foo=bar", "/failifmismatch:abc=def", + "/failifmismatch:\"foo=bar\"", "/failifmismatch:abc=def", "a.out", nullptr)); } |

