diff options
author | Rui Ueyama <ruiu@google.com> | 2014-11-25 19:01:01 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2014-11-25 19:01:01 +0000 |
commit | 0d9a181d9d36523cadd6fb17d5465778541ea202 (patch) | |
tree | 6a0dbb9cd61f823fcbf191ddee7d4c0c8a5cd689 /lld/unittests | |
parent | bda193edffea77f7262b041878d5a1d85c917700 (diff) | |
download | bcm5719-llvm-0d9a181d9d36523cadd6fb17d5465778541ea202.tar.gz bcm5719-llvm-0d9a181d9d36523cadd6fb17d5465778541ea202.zip |
[PECOFF] Create an empty PDB file if debug option is enabled.
There are many build files in the wild that depend on the fact that
link.exe produces a PDB file if /DEBUG option is given. They fail
if the file is not created.
This patch is to make LLD create an empty (dummy) file to satisfy
such build targets. This doesn't do anything other than "touching"
the file.
If a target depends on the content of the PDB file, this workaround
is no help, of course. Otherwise this patch should help build some
stuff.
llvm-svn: 222773
Diffstat (limited to 'lld/unittests')
-rw-r--r-- | lld/unittests/DriverTests/WinLinkDriverTest.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lld/unittests/DriverTests/WinLinkDriverTest.cpp b/lld/unittests/DriverTests/WinLinkDriverTest.cpp index 8b95a984943..26f0afa9186 100644 --- a/lld/unittests/DriverTests/WinLinkDriverTest.cpp +++ b/lld/unittests/DriverTests/WinLinkDriverTest.cpp @@ -546,8 +546,16 @@ TEST_F(WinLinkParserTest, SwapRunFromNet) { } TEST_F(WinLinkParserTest, Debug) { - EXPECT_TRUE(parse("link.exe", "/debug", "a.out", nullptr)); + EXPECT_TRUE(parse("link.exe", "/debug", "a.obj", nullptr)); EXPECT_TRUE(_context.deadStrip()); + EXPECT_TRUE(_context.getDebug()); + EXPECT_EQ("a.pdb", _context.getPDBFilePath()); +} + +TEST_F(WinLinkParserTest, PDB) { + EXPECT_TRUE(parse("link.exe", "/debug", "/pdb:foo.pdb", "a.obj", nullptr)); + EXPECT_TRUE(_context.getDebug()); + EXPECT_EQ("foo.pdb", _context.getPDBFilePath()); } TEST_F(WinLinkParserTest, Fixed) { @@ -690,10 +698,10 @@ TEST_F(WinLinkParserTest, Ignore) { // compatibility with link.exe. EXPECT_TRUE(parse("link.exe", "/nologo", "/errorreport:prompt", "/incremental", "/incremental:no", "/delay:unload", - "/disallowlib:foo", "/pdb:foo", - "/pdbaltpath:bar", "/verbose", "/verbose:icf", "/wx", - "/wx:no", "/tlbid:1", "/tlbout:foo", "/idlout:foo", - "/ignore:4000", "/ignoreidl", "/implib:foo", "/safeseh", + "/disallowlib:foo", "/pdbaltpath:bar", "/verbose", + "/verbose:icf", "/wx", "/wx:no", "/tlbid:1", + "/tlbout:foo", "/idlout:foo", "/ignore:4000", + "/ignoreidl", "/implib:foo", "/safeseh", "/safeseh:no", "/functionpadmin", "a.obj", nullptr)); EXPECT_EQ("", errorMessage()); EXPECT_EQ(3, inputFileCount()); |