summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/PR2978.m
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-02-11 22:13:20 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-02-11 22:13:20 +0000
commit982c42da64e160cd6ef94fc1df18698036cce7f8 (patch)
treea682abd22ee0426b4bb777552d5d5d446ef2913a /clang/test/Analysis/PR2978.m
parent9c1c3ac627339d02cbf5a30f1c6ba6ecbebfa587 (diff)
downloadbcm5719-llvm-982c42da64e160cd6ef94fc1df18698036cce7f8.tar.gz
bcm5719-llvm-982c42da64e160cd6ef94fc1df18698036cce7f8.zip
[analyzer] Improve pattern matching in ObjCDealloc checker.
Look through PseudoObjectExpr and OpaqueValueExprs when scanning for release-like operations. This commit also adds additional tests in anticipation of re-writing this as a path-sensitive checker. llvm-svn: 260608
Diffstat (limited to 'clang/test/Analysis/PR2978.m')
-rw-r--r--clang/test/Analysis/PR2978.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Analysis/PR2978.m b/clang/test/Analysis/PR2978.m
index 1fbd9723a2b..2067b3e85af 100644
--- a/clang/test/Analysis/PR2978.m
+++ b/clang/test/Analysis/PR2978.m
@@ -17,6 +17,8 @@
id _L;
id _N;
id _M;
+ id _P;
+ id _Q;
id _V;
id _W;
}
@@ -27,6 +29,9 @@
@property(weak) id L;
@property(readonly) id N;
@property(retain) id M;
+@property(weak) id P; // expected-warning {{'_P' instance variable in 'MyClass' was not retained by a synthesized property but was released in 'dealloc'}}
+@property(weak) id Q;
+
@property(retain) id V;
@property(retain) id W;
-(id) O;
@@ -41,6 +46,7 @@
@synthesize L = _L; // no-warning
@synthesize N = _N; // no-warning
@synthesize M = _M;
+@synthesize Q = _Q; // expected-warning {{'_Q' instance variable in 'MyClass' was not retained by a synthesized property but was released in 'dealloc'}}
@synthesize V = _V;
@synthesize W = _W; // expected-warning{{The '_W' instance variable in 'MyClass' was retained by a synthesized property but was not released in 'dealloc'}}
@@ -57,6 +63,9 @@
[self setV:0]; // This will release '_V'
[self setW:@"newW"]; // This will release '_W', but retain the new value
self.O = 0; // no-warning
+
+ [_Q release];
+ self.P = 0;
[super dealloc];
return 0;
}
OpenPOWER on IntegriCloud