[cfe-commits] r163406 - /cfe/trunk/test/Analysis/misc-ps.c

Ted Kremenek kremenek at apple.com
Fri Sep 7 12:09:51 PDT 2012


Author: kremenek
Date: Fri Sep  7 14:09:51 2012
New Revision: 163406

URL: http://llvm.org/viewvc/llvm-project?rev=163406&view=rev
Log:
Add test case for <rdar://problem/12075238>, which recently got fixed by changes to RegionStore.

Modified:
    cfe/trunk/test/Analysis/misc-ps.c

Modified: cfe/trunk/test/Analysis/misc-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.c?rev=163406&r1=163405&r2=163406&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps.c (original)
+++ cfe/trunk/test/Analysis/misc-ps.c Fri Sep  7 14:09:51 2012
@@ -133,3 +133,21 @@
   return (c < 1 || c > 10) ? 0 : !!(c & f);
 }
 
+// Test that symbolic array offsets are modeled conservatively.
+// This was triggering a false "use of uninitialized value" warning.
+void rdar_12075238__aux(unsigned long y);
+int rdar_12075238_(unsigned long count) {
+  if ((count < 3) || (count > 6))
+    return 0;
+	
+  unsigned long array[6];
+  unsigned long i = 0;
+  for (; i <= count - 2; i++)
+  {
+	  array[i] = i;
+  }
+  array[count - 1] = i;
+  rdar_12075238__aux(array[2]); // no-warning
+  return 0;
+}
+





More information about the cfe-commits mailing list