summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-19 02:22:02 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-19 02:22:02 +0000
commita3fcbeb908158e823223be291cb166357aed6853 (patch)
treef766e16aaa6977f030aee5c756e214804da1d0a0 /clang/test
parent31567515edf127b49e60a769527faf7b41c075ea (diff)
downloadbcm5719-llvm-a3fcbeb908158e823223be291cb166357aed6853.tar.gz
bcm5719-llvm-a3fcbeb908158e823223be291cb166357aed6853.zip
[objcmt] When checking whether the subscripting methods are declared use
ObjCInterfaceDec::lookupInstanceMethod to make sure we check categories as well and update related tests. rdar://11695288 llvm-svn: 158697
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m26
-rw-r--r--clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m.result26
-rw-r--r--clang/test/ARCMT/objcmt-subscripting-literals.m26
-rw-r--r--clang/test/ARCMT/objcmt-subscripting-literals.m.result26
4 files changed, 76 insertions, 28 deletions
diff --git a/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m b/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m
index fd100ca94da..4d941626c0d 100644
--- a/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m
+++ b/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m
@@ -12,6 +12,9 @@ typedef const struct __CFString * CFStringRef;
+ (id)alloc;
@end
+@protocol NSCopying
+@end
+
@interface NSString : NSObject
+ (id)stringWithString:(NSString *)string;
- (id)initWithString:(NSString *)aString;
@@ -19,7 +22,10 @@ typedef const struct __CFString * CFStringRef;
@interface NSArray : NSObject
- (id)objectAtIndex:(unsigned long)index;
-- (id)objectAtIndexedSubscript:(int)index;
+@end
+
+@interface NSArray (NSExtendedArray)
+- (id)objectAtIndexedSubscript:(unsigned)idx;
@end
@interface NSArray (NSArrayCreation)
@@ -32,16 +38,21 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
- (id)initWithObjects:(id)firstObj, ...;
- (id)initWithArray:(NSArray *)array;
-
-- (id)objectAtIndex:(unsigned long)index;
@end
@interface NSMutableArray : NSArray
- (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
-- (void)setObject:(id)object atIndexedSubscript:(int)index;
+@end
+
+@interface NSMutableArray (NSExtendedMutableArray)
+- (void)setObject:(id)obj atIndexedSubscript:(unsigned)idx;
@end
@interface NSDictionary : NSObject
+- (id)objectForKey:(id)aKey;
+@end
+
+@interface NSDictionary (NSExtendedDictionary)
- (id)objectForKeyedSubscript:(id)key;
@end
@@ -57,13 +68,14 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjectsAndKeys:(id)firstObject, ...;
- (id)initWithDictionary:(NSDictionary *)otherDictionary;
- (id)initWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
-
-- (id)objectForKey:(id)aKey;
@end
@interface NSMutableDictionary : NSDictionary
- (void)setObject:(id)anObject forKey:(id)aKey;
-- (void)setObject:(id)object forKeyedSubscript:(id)key;
+@end
+
+@interface NSMutableDictionary (NSExtendedMutableDictionary)
+- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
@end
@interface NSNumber : NSObject
diff --git a/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m.result b/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m.result
index 4a65a234428..6f7a723bc47 100644
--- a/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m.result
+++ b/clang/test/ARCMT/objcmt-subscripting-literals-in-arc.m.result
@@ -12,6 +12,9 @@ typedef const struct __CFString * CFStringRef;
+ (id)alloc;
@end
+@protocol NSCopying
+@end
+
@interface NSString : NSObject
+ (id)stringWithString:(NSString *)string;
- (id)initWithString:(NSString *)aString;
@@ -19,7 +22,10 @@ typedef const struct __CFString * CFStringRef;
@interface NSArray : NSObject
- (id)objectAtIndex:(unsigned long)index;
-- (id)objectAtIndexedSubscript:(int)index;
+@end
+
+@interface NSArray (NSExtendedArray)
+- (id)objectAtIndexedSubscript:(unsigned)idx;
@end
@interface NSArray (NSArrayCreation)
@@ -32,16 +38,21 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
- (id)initWithObjects:(id)firstObj, ...;
- (id)initWithArray:(NSArray *)array;
-
-- (id)objectAtIndex:(unsigned long)index;
@end
@interface NSMutableArray : NSArray
- (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
-- (void)setObject:(id)object atIndexedSubscript:(int)index;
+@end
+
+@interface NSMutableArray (NSExtendedMutableArray)
+- (void)setObject:(id)obj atIndexedSubscript:(unsigned)idx;
@end
@interface NSDictionary : NSObject
+- (id)objectForKey:(id)aKey;
+@end
+
+@interface NSDictionary (NSExtendedDictionary)
- (id)objectForKeyedSubscript:(id)key;
@end
@@ -57,13 +68,14 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjectsAndKeys:(id)firstObject, ...;
- (id)initWithDictionary:(NSDictionary *)otherDictionary;
- (id)initWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
-
-- (id)objectForKey:(id)aKey;
@end
@interface NSMutableDictionary : NSDictionary
- (void)setObject:(id)anObject forKey:(id)aKey;
-- (void)setObject:(id)object forKeyedSubscript:(id)key;
+@end
+
+@interface NSMutableDictionary (NSExtendedMutableDictionary)
+- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
@end
@interface NSNumber : NSObject
diff --git a/clang/test/ARCMT/objcmt-subscripting-literals.m b/clang/test/ARCMT/objcmt-subscripting-literals.m
index 6d626c4683d..e9ed788275d 100644
--- a/clang/test/ARCMT/objcmt-subscripting-literals.m
+++ b/clang/test/ARCMT/objcmt-subscripting-literals.m
@@ -12,6 +12,9 @@ typedef const struct __CFString * CFStringRef;
+ (id)alloc;
@end
+@protocol NSCopying
+@end
+
@interface NSString : NSObject
+ (id)stringWithString:(NSString *)string;
- (id)initWithString:(NSString *)aString;
@@ -19,7 +22,10 @@ typedef const struct __CFString * CFStringRef;
@interface NSArray : NSObject
- (id)objectAtIndex:(unsigned long)index;
-- (id)objectAtIndexedSubscript:(int)index;
+@end
+
+@interface NSArray (NSExtendedArray)
+- (id)objectAtIndexedSubscript:(unsigned)idx;
@end
@interface NSArray (NSArrayCreation)
@@ -32,16 +38,21 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
- (id)initWithObjects:(id)firstObj, ...;
- (id)initWithArray:(NSArray *)array;
-
-- (id)objectAtIndex:(unsigned long)index;
@end
@interface NSMutableArray : NSArray
- (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
-- (void)setObject:(id)object atIndexedSubscript:(int)index;
+@end
+
+@interface NSMutableArray (NSExtendedMutableArray)
+- (void)setObject:(id)obj atIndexedSubscript:(unsigned)idx;
@end
@interface NSDictionary : NSObject
+- (id)objectForKey:(id)aKey;
+@end
+
+@interface NSDictionary (NSExtendedDictionary)
- (id)objectForKeyedSubscript:(id)key;
@end
@@ -57,13 +68,14 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjectsAndKeys:(id)firstObject, ...;
- (id)initWithDictionary:(NSDictionary *)otherDictionary;
- (id)initWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
-
-- (id)objectForKey:(id)aKey;
@end
@interface NSMutableDictionary : NSDictionary
- (void)setObject:(id)anObject forKey:(id)aKey;
-- (void)setObject:(id)object forKeyedSubscript:(id)key;
+@end
+
+@interface NSMutableDictionary (NSExtendedMutableDictionary)
+- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
@end
@interface NSNumber : NSObject
diff --git a/clang/test/ARCMT/objcmt-subscripting-literals.m.result b/clang/test/ARCMT/objcmt-subscripting-literals.m.result
index a4eca6a447d..4e49c5e344e 100644
--- a/clang/test/ARCMT/objcmt-subscripting-literals.m.result
+++ b/clang/test/ARCMT/objcmt-subscripting-literals.m.result
@@ -12,6 +12,9 @@ typedef const struct __CFString * CFStringRef;
+ (id)alloc;
@end
+@protocol NSCopying
+@end
+
@interface NSString : NSObject
+ (id)stringWithString:(NSString *)string;
- (id)initWithString:(NSString *)aString;
@@ -19,7 +22,10 @@ typedef const struct __CFString * CFStringRef;
@interface NSArray : NSObject
- (id)objectAtIndex:(unsigned long)index;
-- (id)objectAtIndexedSubscript:(int)index;
+@end
+
+@interface NSArray (NSExtendedArray)
+- (id)objectAtIndexedSubscript:(unsigned)idx;
@end
@interface NSArray (NSArrayCreation)
@@ -32,16 +38,21 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
- (id)initWithObjects:(id)firstObj, ...;
- (id)initWithArray:(NSArray *)array;
-
-- (id)objectAtIndex:(unsigned long)index;
@end
@interface NSMutableArray : NSArray
- (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
-- (void)setObject:(id)object atIndexedSubscript:(int)index;
+@end
+
+@interface NSMutableArray (NSExtendedMutableArray)
+- (void)setObject:(id)obj atIndexedSubscript:(unsigned)idx;
@end
@interface NSDictionary : NSObject
+- (id)objectForKey:(id)aKey;
+@end
+
+@interface NSDictionary (NSExtendedDictionary)
- (id)objectForKeyedSubscript:(id)key;
@end
@@ -57,13 +68,14 @@ typedef const struct __CFString * CFStringRef;
- (id)initWithObjectsAndKeys:(id)firstObject, ...;
- (id)initWithDictionary:(NSDictionary *)otherDictionary;
- (id)initWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
-
-- (id)objectForKey:(id)aKey;
@end
@interface NSMutableDictionary : NSDictionary
- (void)setObject:(id)anObject forKey:(id)aKey;
-- (void)setObject:(id)object forKeyedSubscript:(id)key;
+@end
+
+@interface NSMutableDictionary (NSExtendedMutableDictionary)
+- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
@end
@interface NSNumber : NSObject
OpenPOWER on IntegriCloud