summaryrefslogtreecommitdiffstats
path: root/lld/unittests/DriverTests/WinLinkDriverTest.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-02-26 23:43:04 +0000
committerRui Ueyama <ruiu@google.com>2015-02-26 23:43:04 +0000
commit53a93c6c399b7e514f9500283be59022e20034a7 (patch)
treee6464bc87dfe556adce393e362afd77709025885 /lld/unittests/DriverTests/WinLinkDriverTest.cpp
parent17512a95aef43943aedac571d67e3c3967c3eb1a (diff)
downloadbcm5719-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.cpp10
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) {
OpenPOWER on IntegriCloud