2 - (id)objectAtIndexedSubscript:(int)index;
3 + (id)arrayWithObjects:(id *)objects count:(unsigned)count;
6 @interface NSMutableArray : NSArray
7 - (id)objectAtIndexedSubscript:(int)index;
8 - (void)setObject:(id)object atIndexedSubscript:(int)index;
11 @interface NSDictionary
12 - (id)objectForKeyedSubscript:(id)key;
13 + (id)dictionaryWithObjects:(id *)objects forKeys:(id *)keys count:(unsigned)count;
16 @interface NSMutableDictionary : NSDictionary
17 - (void)setObject:(id)object forKeyedSubscript:(id)key;
22 id testArray(int index, id p) {
23 NSMutableArray *array;
25 NSArray *arr = @[ p, p ];
30 NSMutableDictionary *dictionary;
32 id newObject, oldObject;
33 oldObject = dictionary[key];
34 dictionary[key] = newObject;
35 NSDictionary *dict = @{ key: newObject, key: oldObject };
38 // RUN: c-index-test \
40 // RUN: -file-refs-at=%s:22:21 \
41 // CHECK: ParmDecl=index:22:18
42 // CHECK-NEXT: ParmDecl=index:22:18 (Definition) =[22:18 - 22:23]
43 // CHECK-NEXT: DeclRefExpr=index:22:18 =[26:16 - 26:21]
45 // RUN: -file-refs-at=%s:22:28 \
46 // CHECK-NEXT: ParmDecl=p:22:28
47 // CHECK-NEXT: ParmDecl=p:22:28 (Definition) =[22:28 - 22:29]
48 // CHECK-NEXT: DeclRefExpr=p:22:28 =[25:21 - 25:22]
49 // CHECK-NEXT: DeclRefExpr=p:22:28 =[25:24 - 25:25]
51 // RUN: -file-refs-at=%s:34:16 \
52 // CHECK-NEXT: DeclRefExpr=key:31:13
53 // CHECK-NEXT: VarDecl=key:31:13 (Definition) =[31:13 - 31:16]
54 // CHECK-NEXT: DeclRefExpr=key:31:13 =[33:26 - 33:29]
55 // CHECK-NEXT: DeclRefExpr=key:31:13 =[34:14 - 34:17]
56 // CHECK-NEXT: DeclRefExpr=key:31:13 =[35:27 - 35:30]
57 // CHECK-NEXT: DeclRefExpr=key:31:13 =[35:43 - 35:46]
59 // RUN: -file-refs-at=%s:35:35 \
60 // CHECK-NEXT: DeclRefExpr=newObject:32:6
61 // CHECK-NEXT: VarDecl=newObject:32:6 (Definition) =[32:6 - 32:15]
62 // CHECK-NEXT: DeclRefExpr=newObject:32:6 =[34:21 - 34:30]
63 // CHECK-NEXT: DeclRefExpr=newObject:32:6 =[35:32 - 35:41]
65 // RUN: -target x86_64-apple-macosx10.7 %s | FileCheck %s