1 // RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin %s -o /dev/null
3 typedef unsigned int size_t;
6 @interface NSMutableArray
7 #if __has_feature(objc_subscripting)
8 - (id)objectAtIndexedSubscript:(size_t)index;
9 - (void)setObject:(id)object atIndexedSubscript:(size_t)index;
13 #if __has_feature(objc_subscripting)
14 @interface XNSMutableArray
15 - (id)objectAtIndexedSubscript:(size_t)index;
16 - (void)setObject:(id)object atIndexedSubscript:(size_t)index;
20 @interface NSMutableDictionary
21 - (id)objectForKeyedSubscript:(id)key;
22 - (void)setObject:(id)object forKeyedSubscript:(id)key;
28 NSMutableArray<P> * array;
29 id oldObject = array[10];
31 array[10] = oldObject;
34 oldObject = unknown_array[1];
36 unknown_array[1] = oldObject;
38 NSMutableDictionary *dictionary;
41 oldObject = dictionary[key];
42 dictionary[key] = newObject; // replace oldObject with newObject