================
@@ -1275,6 +1303,31 @@ TEST_F(FlowConditionTest, 
WhileStmtWithAssignmentInCondition) {
       });
 }
 
+TEST_F(FlowConditionTest, GotoLoopWithAssignmentInCondition) {
+  std::string Code = R"cc(
+    void target(bool Foo) {
+      // This test checks whether the analysis preserves the connection between
+      // the value of `Foo` and the assignment expression, despite widening.
+      // The equality operator generates a fresh boolean variable on each
----------------
jvoung wrote:

FWIW, this is a copy of the above `WhileStmtWithAssignmentInCondition` but with 
a goto instead.

I think before https://github.com/llvm/llvm-project/pull/178943, a call to a 
bool-valued function would have stuck with an unknown value and didn't trigger 
Widen.

Now that 178943 has landed, the call works. So switched to that to be less 
confusing. (Alternatively, could do something like `Foo = (X == 4)` but the 
call works now)

https://github.com/llvm/llvm-project/pull/179546
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to