Skip to content

Commit 6236bf5

Browse files
committed
[clang][dataflow] Strengthen flow condition assertions.
Instead of asserting merely that the flow condition doesn't imply that a variable is true, make the stronger assertion that the flow condition implies that the variable is false. Reviewed By: ymandel, xazax.hun Differential Revision: https://reviews.llvm.org/D155067
1 parent 7324535 commit 6236bf5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,7 +3619,8 @@ TEST(TransferTest, BooleanEquality) {
36193619
EXPECT_TRUE(EnvThen.flowConditionImplies(BarValThen));
36203620

36213621
auto &BarValElse = getFormula(*BarDecl, EnvElse);
3622-
EXPECT_FALSE(EnvElse.flowConditionImplies(BarValElse));
3622+
EXPECT_TRUE(
3623+
EnvElse.flowConditionImplies(EnvElse.arena().makeNot(BarValElse)));
36233624
});
36243625
}
36253626

@@ -3650,7 +3651,8 @@ TEST(TransferTest, BooleanInequality) {
36503651
ASSERT_THAT(BarDecl, NotNull());
36513652

36523653
auto &BarValThen = getFormula(*BarDecl, EnvThen);
3653-
EXPECT_FALSE(EnvThen.flowConditionImplies(BarValThen));
3654+
EXPECT_TRUE(
3655+
EnvThen.flowConditionImplies(EnvThen.arena().makeNot(BarValThen)));
36543656

36553657
auto &BarValElse = getFormula(*BarDecl, EnvElse);
36563658
EXPECT_TRUE(EnvElse.flowConditionImplies(BarValElse));

0 commit comments

Comments
 (0)