mboehme created this revision. Herald added subscribers: martong, xazax.hun. Herald added a project: All. mboehme requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D155067 Files: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp Index: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp =================================================================== --- clang/unittests/Analysis/FlowSensitive/TransferTest.cpp +++ clang/unittests/Analysis/FlowSensitive/TransferTest.cpp @@ -3530,7 +3530,7 @@ EXPECT_TRUE(EnvThen.flowConditionImplies(BarValThen)); auto &BarValElse = *cast<BoolValue>(EnvElse.getValue(*BarDecl)); - EXPECT_FALSE(EnvElse.flowConditionImplies(BarValElse)); + EXPECT_TRUE(EnvElse.flowConditionImplies(EnvElse.makeNot(BarValElse))); }); } @@ -3561,7 +3561,7 @@ ASSERT_THAT(BarDecl, NotNull()); auto &BarValThen = *cast<BoolValue>(EnvThen.getValue(*BarDecl)); - EXPECT_FALSE(EnvThen.flowConditionImplies(BarValThen)); + EXPECT_TRUE(EnvThen.flowConditionImplies(EnvThen.makeNot(BarValThen))); auto &BarValElse = *cast<BoolValue>(EnvElse.getValue(*BarDecl)); EXPECT_TRUE(EnvElse.flowConditionImplies(BarValElse));
Index: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp =================================================================== --- clang/unittests/Analysis/FlowSensitive/TransferTest.cpp +++ clang/unittests/Analysis/FlowSensitive/TransferTest.cpp @@ -3530,7 +3530,7 @@ EXPECT_TRUE(EnvThen.flowConditionImplies(BarValThen)); auto &BarValElse = *cast<BoolValue>(EnvElse.getValue(*BarDecl)); - EXPECT_FALSE(EnvElse.flowConditionImplies(BarValElse)); + EXPECT_TRUE(EnvElse.flowConditionImplies(EnvElse.makeNot(BarValElse))); }); } @@ -3561,7 +3561,7 @@ ASSERT_THAT(BarDecl, NotNull()); auto &BarValThen = *cast<BoolValue>(EnvThen.getValue(*BarDecl)); - EXPECT_FALSE(EnvThen.flowConditionImplies(BarValThen)); + EXPECT_TRUE(EnvThen.flowConditionImplies(EnvThen.makeNot(BarValThen))); auto &BarValElse = *cast<BoolValue>(EnvElse.getValue(*BarDecl)); EXPECT_TRUE(EnvElse.flowConditionImplies(BarValElse));
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits