@@ -4548,16 +4548,16 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicRWStructType) {
45484548 EntryBB->getFirstInsertionPt ());
45494549
45504550 LLVMContext &Ctx = M->getContext ();
4551-
4551+
45524552 // Create a struct type {double, double} to simulate complex(8) - 16 bytes
45534553 StructType *Complex8Ty = StructType::create (
45544554 Ctx, {Type::getDoubleTy (Ctx), Type::getDoubleTy (Ctx)}, " complex" );
4555-
4555+
45564556 AllocaInst *XVal = Builder.CreateAlloca (Complex8Ty);
45574557 XVal->setName (" AtomicVar" );
45584558 OpenMPIRBuilder::AtomicOpValue X = {XVal, Complex8Ty, false , false };
45594559 AtomicOrdering AO = AtomicOrdering::SequentiallyConsistent;
4560-
4560+
45614561 // Create value to write: {1.0, 1.0}
45624562 Constant *Real = ConstantFP::get (Type::getDoubleTy (Ctx), 1.0 );
45634563 Constant *Imag = ConstantFP::get (Type::getDoubleTy (Ctx), 1.0 );
@@ -4571,10 +4571,8 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicRWStructType) {
45714571 AllocaInst *VVal = Builder.CreateAlloca (Complex8Ty);
45724572 VVal->setName (" ReadDest" );
45734573 OpenMPIRBuilder::AtomicOpValue V = {VVal, Complex8Ty, false , false };
4574- Value *ReadResult = nullptr ;
4575-
4576- Builder.restoreIP (
4577- OMPBuilder.createAtomicRead (Loc, X, ReadResult, AO, AllocaIP));
4574+
4575+ Builder.restoreIP (OMPBuilder.createAtomicRead (Loc, X, V, AO, AllocaIP));
45784576
45794577 Builder.CreateRetVoid ();
45804578 OMPBuilder.finalize ();
@@ -4583,7 +4581,7 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicRWStructType) {
45834581 // Verify that __atomic_store and __atomic_load are called with size 16
45844582 bool FoundAtomicStore = false ;
45854583 bool FoundAtomicLoad = false ;
4586-
4584+
45874585 for (Function &Fn : *M) {
45884586 if (Fn.getName ().starts_with (" __atomic_store" )) {
45894587 // Check that first call to __atomic_store has size argument = 16
@@ -4610,7 +4608,7 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicRWStructType) {
46104608 }
46114609 }
46124610 }
4613-
4611+
46144612 EXPECT_TRUE (FoundAtomicStore) << " Did not find __atomic_store call" ;
46154613 EXPECT_TRUE (FoundAtomicLoad) << " Did not find __atomic_load call" ;
46164614}
@@ -7657,8 +7655,7 @@ TEST_F(OpenMPIRBuilderTest, CreateTaskgroup) {
76577655 // Checking the general structure of the IR generated is same as expected.
76587656 Instruction *GeneratedStoreInst = TaskgroupCall->getNextNode ();
76597657 EXPECT_EQ (GeneratedStoreInst, InternalStoreInst);
7660- Instruction *GeneratedLoad32 =
7661- GeneratedStoreInst->getNextNode ();
7658+ Instruction *GeneratedLoad32 = GeneratedStoreInst->getNextNode ();
76627659 EXPECT_EQ (GeneratedLoad32, InternalLoad32);
76637660 Instruction *GeneratedLoad128 = GeneratedLoad32->getNextNode ();
76647661 EXPECT_EQ (GeneratedLoad128, InternalLoad128);
0 commit comments