From a21397fb01925039cb7df436ae55fc4268559856 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 30 May 2013 23:29:28 +0000 Subject: [PATCH] [WinLink] Add a test for Windows-style command line options. llvm-svn: 182971 --- lld/unittests/DriverTests/WinLinkDriverTest.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lld/unittests/DriverTests/WinLinkDriverTest.cpp b/lld/unittests/DriverTests/WinLinkDriverTest.cpp index deeb6dce27d2..fd3cf1b722bb 100644 --- a/lld/unittests/DriverTests/WinLinkDriverTest.cpp +++ b/lld/unittests/DriverTests/WinLinkDriverTest.cpp @@ -66,7 +66,18 @@ TEST_F(ParserTest, Basic) { EXPECT_EQ("c.obj", inputFiles[2].getPath()); } -TEST_F(ParserTest, NoFileEXtension) { +TEST_F(ParserTest, WindowsStyleOption) { + parse("/subsystem:console", "/out:a.exe", "a.obj", nullptr); + + EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI, info.getSubsystem()); + EXPECT_EQ("a.exe", info.outputPath()); + + const std::vector &inputFiles = info.inputFiles(); + EXPECT_EQ((size_t)1, inputFiles.size()); + EXPECT_EQ("a.obj", inputFiles[0].getPath()); +} + +TEST_F(ParserTest, NoFileExtension) { parse("foo", "bar", nullptr); EXPECT_EQ("foo.exe", info.outputPath());