Skip to content

Commit 88ef76c

Browse files
authored
[NFC][ModuleUtils] Rename test function (#101750)
1 parent 874cd10 commit 88ef76c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

llvm/unittests/Transforms/Utils/ModuleUtilsTest.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {
2424
return Mod;
2525
}
2626

27-
static int getUsedListSize(Module &M, StringRef Name) {
28-
auto *UsedList = M.getGlobalVariable(Name);
29-
if (!UsedList)
27+
static int getListSize(Module &M, StringRef Name) {
28+
auto *List = M.getGlobalVariable(Name);
29+
if (!List)
3030
return 0;
31-
auto *UsedListBaseArrayType = cast<ArrayType>(UsedList->getValueType());
32-
return UsedListBaseArrayType->getNumElements();
31+
auto *T = cast<ArrayType>(List->getValueType());
32+
return T->getNumElements();
3333
}
3434

3535
TEST(ModuleUtils, AppendToUsedList1) {
@@ -41,13 +41,13 @@ TEST(ModuleUtils, AppendToUsedList1) {
4141
for (auto &G : M->globals()) {
4242
Globals.push_back(&G);
4343
}
44-
EXPECT_EQ(0, getUsedListSize(*M, "llvm.compiler.used"));
44+
EXPECT_EQ(0, getListSize(*M, "llvm.compiler.used"));
4545
appendToCompilerUsed(*M, Globals);
46-
EXPECT_EQ(1, getUsedListSize(*M, "llvm.compiler.used"));
46+
EXPECT_EQ(1, getListSize(*M, "llvm.compiler.used"));
4747

48-
EXPECT_EQ(0, getUsedListSize(*M, "llvm.used"));
48+
EXPECT_EQ(0, getListSize(*M, "llvm.used"));
4949
appendToUsed(*M, Globals);
50-
EXPECT_EQ(1, getUsedListSize(*M, "llvm.used"));
50+
EXPECT_EQ(1, getListSize(*M, "llvm.used"));
5151
}
5252

5353
TEST(ModuleUtils, AppendToUsedList2) {
@@ -59,11 +59,11 @@ TEST(ModuleUtils, AppendToUsedList2) {
5959
for (auto &G : M->globals()) {
6060
Globals.push_back(&G);
6161
}
62-
EXPECT_EQ(0, getUsedListSize(*M, "llvm.compiler.used"));
62+
EXPECT_EQ(0, getListSize(*M, "llvm.compiler.used"));
6363
appendToCompilerUsed(*M, Globals);
64-
EXPECT_EQ(1, getUsedListSize(*M, "llvm.compiler.used"));
64+
EXPECT_EQ(1, getListSize(*M, "llvm.compiler.used"));
6565

66-
EXPECT_EQ(0, getUsedListSize(*M, "llvm.used"));
66+
EXPECT_EQ(0, getListSize(*M, "llvm.used"));
6767
appendToUsed(*M, Globals);
68-
EXPECT_EQ(1, getUsedListSize(*M, "llvm.used"));
68+
EXPECT_EQ(1, getListSize(*M, "llvm.used"));
6969
}

0 commit comments

Comments
 (0)