]> granicus.if.org Git - clang/commitdiff
Updated test case.
authorTed Kremenek <kremenek@apple.com>
Wed, 24 Sep 2008 06:40:03 +0000 (06:40 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 24 Sep 2008 06:40:03 +0000 (06:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56548 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/null-deref-ps.c

index 1fdcd06d431964ab262111e9531170e69e7ffa1c..a085d5a963eda5b3d64e96e122e42155d70950bf 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang -checker-simple -verify %s
+// RUN: clang -std=gnu99 -checker-simple -verify %s
 
 #include<stdint.h>
 #include <assert.h>
@@ -94,8 +94,9 @@ int* qux();
 int f9(unsigned len) {
   assert (len != 0);
   int *p = 0;
+  unsigned i;
 
-  for (unsigned i = 0; i < len; ++i)
+  for (i = 0; i < len; ++i)
    p = qux(i);
 
   return *p++; // no-warning
@@ -104,8 +105,9 @@ int f9(unsigned len) {
 int f9b(unsigned len) {
   assert (len > 0);  // note use of '>'
   int *p = 0;
+  unsigned i;
 
-  for (unsigned i = 0; i < len; ++i)
+  for (i = 0; i < len; ++i)
    p = qux(i);
 
   return *p++; // no-warning