Author: Martin Braenne Date: 2023-07-18T13:41:43Z New Revision: 6236bf53418eb23c62a73d6346f0edec914084e7
URL: https://github.com/llvm/llvm-project/commit/6236bf53418eb23c62a73d6346f0edec914084e7 DIFF: https://github.com/llvm/llvm-project/commit/6236bf53418eb23c62a73d6346f0edec914084e7.diff LOG: [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 Added: Modified: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp Removed: ################################################################################ diff --git a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp index e2800452ab6bdb..291f8329a60fde 100644 --- a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp +++ b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp @@ -3619,7 +3619,8 @@ TEST(TransferTest, BooleanEquality) { EXPECT_TRUE(EnvThen.flowConditionImplies(BarValThen)); auto &BarValElse = getFormula(*BarDecl, EnvElse); - EXPECT_FALSE(EnvElse.flowConditionImplies(BarValElse)); + EXPECT_TRUE( + EnvElse.flowConditionImplies(EnvElse.arena().makeNot(BarValElse))); }); } @@ -3650,7 +3651,8 @@ TEST(TransferTest, BooleanInequality) { ASSERT_THAT(BarDecl, NotNull()); auto &BarValThen = getFormula(*BarDecl, EnvThen); - EXPECT_FALSE(EnvThen.flowConditionImplies(BarValThen)); + EXPECT_TRUE( + EnvThen.flowConditionImplies(EnvThen.arena().makeNot(BarValThen))); auto &BarValElse = getFormula(*BarDecl, EnvElse); EXPECT_TRUE(EnvElse.flowConditionImplies(BarValElse)); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits