[cfe-commits] r84070 - /cfe/trunk/test/Analysis/retain-release-region-store.m

Ted Kremenek kremenek at apple.com
Tue Oct 13 18:54:16 PDT 2009


Author: kremenek
Date: Tue Oct 13 20:54:16 2009
New Revision: 84070

URL: http://llvm.org/viewvc/llvm-project?rev=84070&view=rev
Log:
Add test case for <rdar://problem/7257223>, and XFAIL this test until it passes.

Modified:
    cfe/trunk/test/Analysis/retain-release-region-store.m

Modified: cfe/trunk/test/Analysis/retain-release-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-region-store.m?rev=84070&r1=84069&r2=84070&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/retain-release-region-store.m (original)
+++ cfe/trunk/test/Analysis/retain-release-region-store.m Tue Oct 13 20:54:16 2009
@@ -1,4 +1,5 @@
 // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// XFAIL
 
 //===----------------------------------------------------------------------===//
 // The following code is reduced using delta-debugging from
@@ -115,4 +116,27 @@
 }
 @end
 
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7257223> - False positive due to not invalidating the
+// reference count of a tracked region that was itself invalidated.
+//===----------------------------------------------------------------------===//
+
+typedef struct __rdar_7257223 { CFDateRef x; } RDar7257223;
+void rdar_7257223_aux(RDar7257223 *p);
+
+// THIS CASE CURRENTLY FAILS.
+CFDateRef rdar7257223_Create(void) {
+  RDar7257223 s;
+  CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+  s.x = CFDateCreate(0, t); // no-warning
+  rdar_7257223_aux(&s);
+  return s.x;
+}
+
+CFDateRef rdar7257223_Create_2(void) {
+  RDar7257223 s;
+  CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+  s.x = CFDateCreate(0, t); // no-warning
+  return s.x;
+}
 





More information about the cfe-commits mailing list