Skip to content

Commit 14e6350

Browse files
committed
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.' llvm-svn: 58109
1 parent 03466c2 commit 14e6350

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

clang/test/Analysis/refcnt_naming.m

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: clang -checker-cfref -verify %s
2-
// XFAIL
32

43
typedef const struct __CFString * CFStringRef;
54
typedef const struct __CFAllocator * CFAllocatorRef;
@@ -12,8 +11,11 @@ @interface NSObject <NSObject> {} @end
1211

1312
@interface MyClass : NSObject
1413
{
14+
id myObject;
1515
}
1616
- (NSURL *)myMethod:(NSString *)inString;
17+
- (NSURL *)getMethod:(NSString*)inString;
18+
- (void)addObject:(id)X;
1719
@end
1820

1921
@implementation MyClass
@@ -24,4 +26,17 @@ - (NSURL *)myMethod:(NSString *)inString
2426
return url; // expected-warning{{leak}}
2527
}
2628

29+
- (NSURL *)getMethod:(NSString *)inString
30+
{
31+
NSURL *url = (NSURL *)CFURLCreateWithString(0, (CFStringRef)inString, 0);
32+
[self addObject:url];
33+
return url; // no-warning
34+
}
35+
36+
37+
- (void)addObject:(id)X
38+
{
39+
myObject = X;
40+
}
41+
2742
@end

0 commit comments

Comments
 (0)