14 changes: 8 additions & 6 deletions llvm/unittests/ADT/StringMapTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ TEST_F(StringMapTest, IterationTest) {

// Test StringMapEntry::Create() method.
TEST_F(StringMapTest, StringMapEntryTest) {
StringMap<uint32_t>::value_type* entry =
MallocAllocator Allocator;
StringMap<uint32_t>::value_type *entry =
StringMap<uint32_t>::value_type::Create(
StringRef(testKeyFirst, testKeyLength), 1u);
StringRef(testKeyFirst, testKeyLength), Allocator, 1u);
EXPECT_STREQ(testKey, entry->first().data());
EXPECT_EQ(1u, entry->second);
free(entry);
Expand Down Expand Up @@ -353,14 +354,15 @@ TEST_F(StringMapTest, MoveOnly) {
StringMap<MoveOnly> t;
t.insert(std::make_pair("Test", MoveOnly(42)));
StringRef Key = "Test";
StringMapEntry<MoveOnly>::Create(Key, MoveOnly(42))
->Destroy();
StringMapEntry<MoveOnly>::Create(Key, t.getAllocator(), MoveOnly(42))
->Destroy(t.getAllocator());
}

TEST_F(StringMapTest, CtorArg) {
StringRef Key = "Test";
StringMapEntry<MoveOnly>::Create(Key, Immovable())
->Destroy();
MallocAllocator Allocator;
StringMapEntry<MoveOnly>::Create(Key, Allocator, Immovable())
->Destroy(Allocator);
}

TEST_F(StringMapTest, MoveConstruct) {
Expand Down
7 changes: 4 additions & 3 deletions llvm/unittests/ADT/StringSetTest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- llvm/unittest/ADT/StringSetTest.cpp - StringSet unit tests ----------===//
//===- llvm/unittest/ADT/StringSetTest.cpp - StringSet unit tests ---------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down Expand Up @@ -33,12 +33,13 @@ TEST_F(StringSetTest, InsertAndCountStringMapEntry) {
// Test insert(StringMapEntry) and count(StringMapEntry)
// which are required for set_difference(StringSet, StringSet).
StringSet<> Set;
StringMapEntry<StringRef> *Element = StringMapEntry<StringRef>::Create("A");
StringMapEntry<StringRef> *Element =
StringMapEntry<StringRef>::Create("A", Set.getAllocator());
Set.insert(*Element);
size_t Count = Set.count(*Element);
size_t Expected = 1;
EXPECT_EQ(Expected, Count);
Element->Destroy();
Element->Destroy(Set.getAllocator());
}

TEST_F(StringSetTest, EmptyString) {
Expand Down