aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-11-14 23:03:55 +0000
committerJordan Rose <jordan_rose@apple.com>2012-11-14 23:03:55 +0000
commit318fd66628d3ad43459c38d5bffb4ffe202028c3 (patch)
tree8322f89ee257b33c237a592dcdbd58e5ff00fe3a
parent526e627d2bd7e8cbf630526d315c90864898d9ff (diff)
[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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167994 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/blocks.m29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/Analysis/blocks.m b/test/Analysis/blocks.m
index 54ff58c64f..a64e8e4fc3 100644
--- a/test/Analysis/blocks.m
+++ b/test/Analysis/blocks.m
@@ -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 @@ typedef struct _NSZone NSZone;
@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 @@ void testMessaging() {
// <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