diff options
Diffstat (limited to 'llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp')
-rw-r--r-- | llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp index 2d3d318..5dd0180 100644 --- a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp +++ b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp @@ -3781,6 +3781,9 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicReadFlt) { IRBuilder<> Builder(BB); OpenMPIRBuilder::LocationDescription Loc({Builder.saveIP(), DL}); + BasicBlock *EntryBB = BB; + OpenMPIRBuilder::InsertPointTy AllocaIP(EntryBB, + EntryBB->getFirstInsertionPt()); Type *Float32 = Type::getFloatTy(M->getContext()); AllocaInst *XVal = Builder.CreateAlloca(Float32); @@ -3791,7 +3794,7 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicReadFlt) { OpenMPIRBuilder::AtomicOpValue X = {XVal, Float32, false, false}; OpenMPIRBuilder::AtomicOpValue V = {VVal, Float32, false, false}; - Builder.restoreIP(OMPBuilder.createAtomicRead(Loc, X, V, AO)); + Builder.restoreIP(OMPBuilder.createAtomicRead(Loc, X, V, AO, AllocaIP)); IntegerType *IntCastTy = IntegerType::get(M->getContext(), Float32->getScalarSizeInBits()); @@ -3821,6 +3824,9 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicReadInt) { IRBuilder<> Builder(BB); OpenMPIRBuilder::LocationDescription Loc({Builder.saveIP(), DL}); + BasicBlock *EntryBB = BB; + OpenMPIRBuilder::InsertPointTy AllocaIP(EntryBB, + EntryBB->getFirstInsertionPt()); IntegerType *Int32 = Type::getInt32Ty(M->getContext()); AllocaInst *XVal = Builder.CreateAlloca(Int32); @@ -3831,9 +3837,8 @@ TEST_F(OpenMPIRBuilderTest, OMPAtomicReadInt) { OpenMPIRBuilder::AtomicOpValue X = {XVal, Int32, false, false}; OpenMPIRBuilder::AtomicOpValue V = {VVal, Int32, false, false}; - BasicBlock *EntryBB = BB; + Builder.restoreIP(OMPBuilder.createAtomicRead(Loc, X, V, AO, AllocaIP)); - Builder.restoreIP(OMPBuilder.createAtomicRead(Loc, X, V, AO)); LoadInst *AtomicLoad = nullptr; StoreInst *StoreofAtomic = nullptr; |