Skip to content

Commit a753eca

Browse files
committed
[FuzzMutate] Update unit testing
There are some typos in the previous patch e0117a3 that woulc break unit test and CI. These typos are fixed now. Signed-off-by: Peter Rong <[email protected]>
1 parent e0117a3 commit a753eca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,18 +420,18 @@ TEST(RandomIRBuilderTest, findOrCreateGlobalVariable) {
420420

421421
// Find existing global
422422
std::unique_ptr<Module> M1 = parseAssembly(SourceCode, Ctx);
423-
IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[0]));
423+
IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[1]));
424424
ASSERT_FALSE(verifyModule(*M1, &errs()));
425425
unsigned NumGV1 = M1->getNumNamedValues();
426426
auto [GV1, DidCreate1] =
427-
IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[0]));
427+
IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[1]));
428428
ASSERT_FALSE(verifyModule(*M1, &errs()));
429429
ASSERT_EQ(M1->getNumNamedValues(), NumGV1 + DidCreate1);
430430

431431
// Create new global
432432
std::unique_ptr<Module> M2 = parseAssembly(SourceCode, Ctx);
433433
auto [GV2, DidCreate2] =
434-
IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[1]));
434+
IB.findOrCreateGlobalVariable(&*M2, {}, fuzzerop::onlyType(Types[2]));
435435
ASSERT_FALSE(verifyModule(*M2, &errs()));
436436
ASSERT_TRUE(DidCreate2);
437437
}

0 commit comments

Comments
 (0)