================
@@ -1975,6 +1975,50 @@ TEST_F(LifetimeAnalysisTest, 
LambdaInitCaptureViewByValue) {
 //                    Tests for buildOriginFlowChain
 // ========================================================================= //
 
+TEST_F(LifetimeAnalysisTest, BuildOriginFlowChain) {
+  SetupTest(R"(
+    void target(bool c1, bool c2) {
+      int *s;
+      int *a, *b, *c;
+
+      {
+        int tgta, tgtb, tgtc;
+        a = &tgta;
+        b = &tgtb;
+        c = &tgtc;
+      }
+
+      if (c1) {
+        s = c2 ? a : b;
+      } else {
+        s = c;
+      }
+
+      POINT(after_nested_merge);
+      (void)*s;
+    }
----------------
usx95 wrote:

Just to make sure, can you reset `s` after the point of use and make sure the 
same tests still pass.

```cpp
POINT(after_nested_merge);
(void)*s;
int reset;
s = &reset;
```


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

Reply via email to