aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp')
-rw-r--r--llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
index a1ea784..27c0e0b 100644
--- a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
@@ -1441,8 +1441,7 @@ TEST_F(OpenMPIRBuilderTest, CanonicalLoopSimple) {
EXPECT_EQ(&Loop->getAfter()->front(), RetInst);
}
-TEST_F(OpenMPIRBuilderTest, CanonicalLoopBounds) {
- using InsertPointTy = OpenMPIRBuilder::InsertPointTy;
+TEST_F(OpenMPIRBuilderTest, CanonicalLoopTripCount) {
OpenMPIRBuilder OMPBuilder(*M);
OMPBuilder.initialize();
IRBuilder<> Builder(BB);
@@ -1458,17 +1457,8 @@ TEST_F(OpenMPIRBuilderTest, CanonicalLoopBounds) {
Value *StartVal = ConstantInt::get(LCTy, Start);
Value *StopVal = ConstantInt::get(LCTy, Stop);
Value *StepVal = ConstantInt::get(LCTy, Step);
- auto LoopBodyGenCB = [&](InsertPointTy CodeGenIP, llvm::Value *LC) {
- return Error::success();
- };
- ASSERT_EXPECTED_INIT_RETURN(
- CanonicalLoopInfo *, Loop,
- OMPBuilder.createCanonicalLoop(Loc, LoopBodyGenCB, StartVal, StopVal,
- StepVal, IsSigned, InclusiveStop),
- -1);
- Loop->assertOK();
- Builder.restoreIP(Loop->getAfterIP());
- Value *TripCount = Loop->getTripCount();
+ Value *TripCount = OMPBuilder.calculateCanonicalLoopTripCount(
+ Loc, StartVal, StopVal, StepVal, IsSigned, InclusiveStop);
return cast<ConstantInt>(TripCount)->getValue().getZExtValue();
};