]> granicus.if.org Git - clang/commitdiff
Add analyzer test case for 'ForStmt' with condition variable.
authorTed Kremenek <kremenek@apple.com>
Thu, 24 Dec 2009 02:41:19 +0000 (02:41 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 24 Dec 2009 02:41:19 +0000 (02:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92120 91177308-0d34-0410-b5e6-96231b3b80d8

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

index f71bb0ea3853b4e78d628062c712682d2a8cdc86..225abb5aa19a44481c0ad945b10eb03303dd40ae 100644 (file)
@@ -75,3 +75,17 @@ int test_init_in_condition_while() {
   return 0;
 }
 
+
+int test_init_in_condition_for() {
+  int z = 0;
+  for (int x = 0; int y = ++z; ++x) {
+    if (x == y) // no-warning
+      break;
+  }
+  if (z == 1)
+    return 0;
+    
+  int *p = 0;
+  *p = 0xDEADBEEF; // no-warning
+  return 0;
+}