Author: jrose
Date: Wed Nov 14 17:03:55 2012
New Revision: 167994

URL: http://llvm.org/viewvc/llvm-project?rev=167994&view=rev
Log:
[analyzer] Add a test case for printing a path note at a PreStmt point.

This is also a false-positive test case for <rdar://problem/12415065>.

<rdar://problem/12687586>

Modified:
    cfe/trunk/test/Analysis/blocks.m

Modified: cfe/trunk/test/Analysis/blocks.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/blocks.m?rev=167994&r1=167993&r2=167994&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/blocks.m (original)
+++ cfe/trunk/test/Analysis/blocks.m Wed Nov 14 17:03:55 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze 
-analyzer-checker=core -analyzer-store=region -fblocks -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze 
-analyzer-checker=core -analyzer-store=region -fblocks 
-analyzer-opt-analyze-nested-blocks -verify %s
 
 
//===----------------------------------------------------------------------===//
 // The following code is reduced using delta-debugging from Mac OS X headers:
@@ -26,6 +26,7 @@
 @protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder; @end
 @interface NSObject <NSObject> {}
 + (id)alloc;
+- (id)init;
 - (id)copy;
 @end
 extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
@@ -94,3 +95,29 @@
   // <rdar://problem/12119814>
   [[^(){} copy] release];
 }
+
+
+// FALSE POSITIVE <rdar://problem/12415065>
+@interface rdar12415065
+@end
+
+@implementation rdar12415065
+- (void)test {
+  // At one point this crashed because we created a path note at a
+  // PreStmtPurgeDeadSymbols point but only knew how to deal with PostStmt
+  // points. <rdar://problem/12687586>
+
+  extern dispatch_queue_t queue;
+
+  if (!queue)
+    return;
+
+  dispatch_async(queue, ^{
+    double x = 0.0;
+    if (24.0f < x) {
+      dispatch_async(queue, ^{ (void)x; });
+      [self test];
+    }
+  });
+}
+@end


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to