From 91a95a590a566ecf2906744b6d612a27e33be08d Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 19 Sep 2013 22:19:40 +0000 Subject: [PATCH] [PECOFF] Ignore /errorReport command line option. /errorReport is a command line option to let the linker to report internal linker error information to Microsoft. For LLD that option doesn't make any sense, so it just ignores the option. llvm-svn: 191044 --- lld/lib/Driver/WinLinkOptions.td | 11 ++++++++--- lld/unittests/DriverTests/WinLinkDriverTest.cpp | 8 +++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lld/lib/Driver/WinLinkOptions.td b/lld/lib/Driver/WinLinkOptions.td index bf8eea24dccf..e7983ff5346b 100644 --- a/lld/lib/Driver/WinLinkOptions.td +++ b/lld/lib/Driver/WinLinkOptions.td @@ -56,10 +56,15 @@ def tsaware : F<"tsaware">; def no_tsaware : F<"tsaware:no">, HelpText<"Create non-Terminal Server aware executable">; -// NOLOGO does nothing. It is defined only for link.exe compatibility. -def nologo : F<"nologo">; - def help : F<"help">; def help_q : F<"?">, Alias; def DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>; + +// The flags below do nothing. They are defined only for link.exe compatibility. +multiclass Q { + def "" : Joined<["/", "-", "-?"], name#":">; + def _c : Separate<["/", "-", "-?"], name>, Alias(name)>; +} +def nologo : F<"nologo">; +defm errorreport : Q<"errorreport">; diff --git a/lld/unittests/DriverTests/WinLinkDriverTest.cpp b/lld/unittests/DriverTests/WinLinkDriverTest.cpp index fec482ab715d..2e7f9a07de6f 100644 --- a/lld/unittests/DriverTests/WinLinkDriverTest.cpp +++ b/lld/unittests/DriverTests/WinLinkDriverTest.cpp @@ -256,9 +256,11 @@ TEST_F(WinLinkParserTest, FailIfMismatch_Mismatch) { "/failifmismatch:foo=baz", "a.out", nullptr)); } -TEST_F(WinLinkParserTest, Nologo) { - // NOLOGO flag is for link.exe compatibility. It's recognized but is ignored. - EXPECT_FALSE(parse("link.exe", "/nologo", "a.obj", nullptr)); +TEST_F(WinLinkParserTest, Ignore) { + // There are some no-op command line options that are recognized for + // compatibility with link.exe. + EXPECT_FALSE(parse("link.exe", "/nologo", "/errorreport:prompt", "a.obj", + nullptr)); EXPECT_EQ("", errorMessage()); EXPECT_EQ(1, inputFileCount()); EXPECT_EQ("a.obj", inputFile(0));