]> granicus.if.org Git - clang/commitdiff
Add test case testing field sensitivity. Reduced from <rdar://problem/7114618>.
authorTed Kremenek <kremenek@apple.com>
Mon, 3 Aug 2009 22:23:24 +0000 (22:23 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 3 Aug 2009 22:23:24 +0000 (22:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78008 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/misc-ps-region-store.m

index 2b0299f23f026001a06af147671416d18d8ce67e..6cfd8e53726581f6277f66c5a78d0a8acd29a417 100644 (file)
@@ -139,3 +139,18 @@ again:
     goto again;
   }
 }
+
+// Reduced test case from <rdar://problem/7114618>.
+// Basically a null check is performed on the field value, which is then
+// assigned to a variable and then checked again.
+struct s_7114618 { int *p; };
+void test_rdar_7114618(struct s_7114618 *s) {
+  if (s->p) {
+    int *p = s->p;
+    if (!p) {
+      // Infeasible
+      int *dead = 0;
+      *dead = 0xDEADBEEF; // no-warning
+    }
+  }
+}