[cfe-commits] r58109 - /cfe/trunk/test/Analysis/refcnt_naming.m
Ted Kremenek
kremenek at apple.com
Fri Oct 24 13:33:57 PDT 2008
Author: kremenek
Date: Fri Oct 24 15:33:56 2008
New Revision: 58109
URL: http://llvm.org/viewvc/llvm-project?rev=58109&view=rev
Log:
This test no longer is marked XFAIL.
Enhance test to include a case where a tracked object escapes because it is stored to a local ivar through a method dispatch to 'self.'
Modified:
cfe/trunk/test/Analysis/refcnt_naming.m
Modified: cfe/trunk/test/Analysis/refcnt_naming.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/refcnt_naming.m?rev=58109&r1=58108&r2=58109&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/refcnt_naming.m (original)
+++ cfe/trunk/test/Analysis/refcnt_naming.m Fri Oct 24 15:33:56 2008
@@ -1,5 +1,4 @@
// RUN: clang -checker-cfref -verify %s
-// XFAIL
typedef const struct __CFString * CFStringRef;
typedef const struct __CFAllocator * CFAllocatorRef;
@@ -12,8 +11,11 @@
@interface MyClass : NSObject
{
+ id myObject;
}
- (NSURL *)myMethod:(NSString *)inString;
+- (NSURL *)getMethod:(NSString*)inString;
+- (void)addObject:(id)X;
@end
@implementation MyClass
@@ -24,4 +26,17 @@
return url; // expected-warning{{leak}}
}
+- (NSURL *)getMethod:(NSString *)inString
+{
+ NSURL *url = (NSURL *)CFURLCreateWithString(0, (CFStringRef)inString, 0);
+ [self addObject:url];
+ return url; // no-warning
+}
+
+
+- (void)addObject:(id)X
+{
+ myObject = X;
+}
+
@end
More information about the cfe-commits
mailing list