diff options
author | Rui Ueyama <ruiu@google.com> | 2015-02-26 23:43:04 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-02-26 23:43:04 +0000 |
commit | 53a93c6c399b7e514f9500283be59022e20034a7 (patch) | |
tree | e6464bc87dfe556adce393e362afd77709025885 /lld/unittests/DriverTests/WinLinkDriverTest.cpp | |
parent | 17512a95aef43943aedac571d67e3c3967c3eb1a (diff) | |
download | bcm5719-llvm-53a93c6c399b7e514f9500283be59022e20034a7.tar.gz bcm5719-llvm-53a93c6c399b7e514f9500283be59022e20034a7.zip |
PECOFF: allow more than one /alternatename for the same symbol.
Previously we have a string -> string map to keep the weak alias
symbol mapping. Naturally we can't define more than one weak alias
with that data structure.
This patch is to allow multiple aliases for the same symbol by
changing the map type to string -> set of string map.
llvm-svn: 230702
Diffstat (limited to 'lld/unittests/DriverTests/WinLinkDriverTest.cpp')
-rw-r--r-- | lld/unittests/DriverTests/WinLinkDriverTest.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lld/unittests/DriverTests/WinLinkDriverTest.cpp b/lld/unittests/DriverTests/WinLinkDriverTest.cpp index c87eaa4fb06..c2bc455aa81 100644 --- a/lld/unittests/DriverTests/WinLinkDriverTest.cpp +++ b/lld/unittests/DriverTests/WinLinkDriverTest.cpp @@ -149,9 +149,13 @@ TEST_F(WinLinkParserTest, InputOrder) { // TEST_F(WinLinkParserTest, AlternateName) { - EXPECT_TRUE(parse("link.exe", "/alternatename:sym1=sym2", "a.out", nullptr)); - EXPECT_EQ("sym1", _ctx.getAlternateName("sym2")); - EXPECT_EQ("", _ctx.getAlternateName("foo")); + EXPECT_TRUE(parse("link.exe", "/alternatename:sym1=sym", + "/alternatename:sym2=sym", "a.out", nullptr)); + const std::set<std::string> &aliases = _ctx.getAlternateNames("sym"); + EXPECT_EQ(2U, aliases.size()); + auto it = aliases.begin(); + EXPECT_EQ("sym1", *it++); + EXPECT_EQ("sym2", *it++); } TEST_F(WinLinkParserTest, Export) { |