2 // RUN: %clang_cc1 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c -triple x86_64-apple-darwin11
3 // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s.result
6 typedef signed char BOOL;
7 #define nil ((void*) 0)
13 @interface NSArray : NSObject
14 - (id)objectAtIndex:(unsigned long)index;
17 @interface NSArray (NSArrayCreation)
19 + (id)arrayWithObject:(id)anObject;
20 + (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;
21 + (id)arrayWithObjects:(id)firstObj, ...;
22 + (id)arrayWithArray:(NSArray *)array;
24 - (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
25 - (id)initWithObjects:(id)firstObj, ...;
26 - (id)initWithArray:(NSArray *)array;
29 @interface NSMutableArray : NSArray
30 - (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
33 @interface NSDictionary : NSObject
36 @interface NSDictionary (NSDictionaryCreation)
38 + (id)dictionaryWithObject:(id)object forKey:(id)key;
39 + (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
40 + (id)dictionaryWithObjectsAndKeys:(id)firstObject, ...;
41 + (id)dictionaryWithDictionary:(NSDictionary *)dict;
42 + (id)dictionaryWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
44 - (id)initWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
45 - (id)initWithObjectsAndKeys:(id)firstObject, ...;
46 - (id)initWithDictionary:(NSDictionary *)otherDictionary;
47 - (id)initWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
49 - (id)objectForKey:(id)aKey;
52 @interface NSMutableDictionary : NSDictionary
53 - (void)setObject:(id)anObject forKey:(id)aKey;
70 id o = [arr objectAtIndex:2];
71 o = [dict objectForKey:@"key"];
72 NSMutableArray *marr = 0;
73 NSMutableDictionary *mdict = 0;
74 [marr replaceObjectAtIndex:2 withObject:@"val"];
75 [mdict setObject:@"value" forKey:@"key"];
76 [marr replaceObjectAtIndex:2 withObject:[arr objectAtIndex:4]];
77 [mdict setObject:[dict objectForKey:@"key2"] forKey:@"key"];