Skip to content

Commit dae2e1d

Browse files
committed
Use EXPECT_EQ in the unittests instead of plain assert
This addresses post-review comments from Duncan P. N. Exon Smith to r261485. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261514 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 65b18dd commit dae2e1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

unittests/Analysis/ScalarEvolutionTest.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,13 @@ TEST_F(ScalarEvolutionsTest, SimplifiedPHI) {
255255
ScalarEvolution SE = buildSE(*F);
256256
auto *S1 = SE.getSCEV(PN);
257257
auto *S2 = SE.getSCEV(PN);
258-
assert(isa<SCEVConstant>(S1) && "Expected a SCEV Constant");
258+
auto *ZeroConst = SE.getConstant(Ty, 0);
259259

260260
// At some point, only the first call to getSCEV returned the simplified
261261
// SCEVConstant and later calls just returned a SCEVUnknown referencing the
262262
// PHI node.
263-
assert(S1 == S2 && "Expected identical SCEV values");
263+
EXPECT_EQ(S1, ZeroConst);
264+
EXPECT_EQ(S1, S2);
264265
}
265266

266267
} // end anonymous namespace

0 commit comments

Comments
 (0)