Add back test cases for ns_returns_retained and cf_returns_retained.
llvm-svn: 71312
This commit is contained in:
parent
669604cded
commit
d73cfc734b
|
@ -124,3 +124,20 @@ void f3() {
|
|||
CFRetain(A);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Tests of ownership attributes.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@interface TestOwnershipAttr : NSObject
|
||||
- (NSString*) returnsAnOwnedString __attribute__((ns_returns_retained));
|
||||
- (NSString*) returnsAnOwnedCFString __attribute__((cf_returns_retained));
|
||||
@end
|
||||
|
||||
void test_attr_1(TestOwnershipAttr *X) {
|
||||
NSString *str = [X returnsAnOwnedString]; // no-warning
|
||||
}
|
||||
|
||||
void test_attr_1b(TestOwnershipAttr *X) {
|
||||
NSString *str = [X returnsAnOwnedCFString]; // expected-warning{{leak}}
|
||||
}
|
||||
|
||||
|
|
|
@ -475,3 +475,20 @@ void rdar6704930(unsigned char *s, unsigned int length) {
|
|||
}
|
||||
@end
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Tests of ownership attributes.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@interface TestOwnershipAttr : NSObject
|
||||
- (NSString*) returnsAnOwnedString __attribute__((ns_returns_retained));
|
||||
- (NSString*) returnsAnOwnedCFString __attribute__((cf_returns_retained));
|
||||
@end
|
||||
|
||||
void test_attr_1(TestOwnershipAttr *X) {
|
||||
NSString *str = [X returnsAnOwnedString]; // expected-warning{{leak}}
|
||||
}
|
||||
|
||||
void test_attr_1b(TestOwnershipAttr *X) {
|
||||
NSString *str = [X returnsAnOwnedCFString]; // expected-warning{{leak}}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue