summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-08-07 20:57:35 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-08-07 20:57:35 +0000
commitd45e7cec42aeef87eef76996186597b9a5663de8 (patch)
treecf877eae5427e02dde0d918da21552ceefdbc47f /clang/test/SemaObjC
parent88d99e4f427350dc788a6a0a71c2f93be59a7cde (diff)
downloadbcm5719-llvm-d45e7cec42aeef87eef76996186597b9a5663de8.tar.gz
bcm5719-llvm-d45e7cec42aeef87eef76996186597b9a5663de8.zip
Objective-C arc. Switch the Objective-C dictionary literal in ARC mode
to use non-retain/autorelease API variants of ObjC objects. wip. rdar://17554063 llvm-svn: 215146
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/arc.m5
-rw-r--r--clang/test/SemaObjC/objc-literal-comparison.m3
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/test/SemaObjC/arc.m b/clang/test/SemaObjC/arc.m
index c162d7fdf71..e60fd970f38 100644
--- a/clang/test/SemaObjC/arc.m
+++ b/clang/test/SemaObjC/arc.m
@@ -12,6 +12,7 @@ id CFBridgingRelease(CFTypeRef);
@interface NSDictionary : NSObject
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
- (void)setObject:(id)object forKeyedSubscript:(id)key;
+- (instancetype)initWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
@end
@class NSFastEnumerationState;
@protocol NSFastEnumeration
@@ -746,7 +747,7 @@ void _NSCalcBeze(NSColor* color, NSColor* bezelColors[]); // expected-error {{mu
void rdar12569201(id key, id value) {
// Declarations.
__weak id x = @"foo"; // no-warning
- __weak id y = @{ key : value }; // expected-warning {{assigning dictionary literal to a weak variable; object will be released after assignment}}
+ __weak id y = @{ key : value }; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}
__weak id z = @[ value ]; // expected-warning {{assigning array literal to a weak variable; object will be released after assignment}}
__weak id b = ^() {}; // expected-warning {{assigning block literal to a weak variable; object will be released after assignment}}
__weak id n = @42; // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}
@@ -754,7 +755,7 @@ void rdar12569201(id key, id value) {
__weak id m = @(41 + 1); // expected-warning {{assigning boxed expression to a weak variable; object will be released after assignment}}
// Assignments.
- y = @{ key : value }; // expected-warning {{assigning dictionary literal to a weak variable; object will be released after assignment}}
+ y = @{ key : value }; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}
z = @[ value ]; // expected-warning {{assigning array literal to a weak variable; object will be released after assignment}}
b = ^() {}; // expected-warning {{assigning block literal to a weak variable; object will be released after assignment}}
n = @42; // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}
diff --git a/clang/test/SemaObjC/objc-literal-comparison.m b/clang/test/SemaObjC/objc-literal-comparison.m
index 68ac419ea29..febce3a2672 100644
--- a/clang/test/SemaObjC/objc-literal-comparison.m
+++ b/clang/test/SemaObjC/objc-literal-comparison.m
@@ -10,6 +10,8 @@
typedef signed char BOOL;
+@protocol NSCopying @end
+
@interface BaseObject
+ (instancetype)new;
@end
@@ -31,6 +33,7 @@ typedef signed char BOOL;
@interface NSDictionary : NSObject
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
+- (instancetype)initWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(unsigned long)cnt;
@end
@interface NSString : NSObject
OpenPOWER on IntegriCloud