[llvm] a753eca - [FuzzMutate] Update unit testing

Peter Rong via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 15 16:40:03 PDT 2023


Author: Peter Rong
Date: 2023-04-15T16:39:01-07:00
New Revision: a753eca66f744f521fa45987c4be027f2ad8e75a

URL: https://github.com/llvm/llvm-project/commit/a753eca66f744f521fa45987c4be027f2ad8e75a
DIFF: https://github.com/llvm/llvm-project/commit/a753eca66f744f521fa45987c4be027f2ad8e75a.diff

LOG: [FuzzMutate] Update unit testing

There are some typos in the previous patch e0117a3efacf that woulc break unit test and CI.
These typos are fixed now.

Signed-off-by: Peter Rong <PeterRong96 at gmail.com>

Added: 
    

Modified: 
    llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp b/llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
index 008b41efde5c0..3a1f91ad61ae4 100644
--- a/llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
+++ b/llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp
@@ -420,18 +420,18 @@ TEST(RandomIRBuilderTest, findOrCreateGlobalVariable) {
 
   // Find existing global
   std::unique_ptr<Module> M1 = parseAssembly(SourceCode, Ctx);
-  IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[0]));
+  IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[1]));
   ASSERT_FALSE(verifyModule(*M1, &errs()));
   unsigned NumGV1 = M1->getNumNamedValues();
   auto [GV1, DidCreate1] =
-      IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[0]));
+      IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[1]));
   ASSERT_FALSE(verifyModule(*M1, &errs()));
   ASSERT_EQ(M1->getNumNamedValues(), NumGV1 + DidCreate1);
 
   // Create new global
   std::unique_ptr<Module> M2 = parseAssembly(SourceCode, Ctx);
   auto [GV2, DidCreate2] =
-      IB.findOrCreateGlobalVariable(&*M1, {}, fuzzerop::onlyType(Types[1]));
+      IB.findOrCreateGlobalVariable(&*M2, {}, fuzzerop::onlyType(Types[2]));
   ASSERT_FALSE(verifyModule(*M2, &errs()));
   ASSERT_TRUE(DidCreate2);
 }


        


More information about the llvm-commits mailing list