1 // RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin -o - %s | FileCheck %s
3 typedef unsigned int size_t;
6 @interface NSMutableArray
7 - (id)objectAtIndexedSubscript:(size_t)index;
8 - (void)setObject:(id)object atIndexedSubscript:(size_t)index;
12 operator unsigned int ();
16 @interface NSMutableDictionary
17 - (id)objectForKeyedSubscript:(id)key;
18 - (void)setObject:(id)object forKeyedSubscript:(id)key;
22 NSMutableArray<P> * array;
24 id oldObject = array[(int)s];
26 NSMutableDictionary<P> *dict;
27 dict[(id)s] = oldObject;
28 oldObject = dict[(id)s];
32 template <class T> void test2(NSMutableArray *a) {
35 template void test2<int>(NSMutableArray*);
36 // CHECK-LABEL: define weak_odr void @_Z5test2IiEvP14NSMutableArray
37 // CHECK: @objc_msgSend
41 template <class T> void test3(NSMutableArray *a) {
45 template void test3<int>(NSMutableArray*);
46 // CHECK-LABEL: define weak_odr void @_Z5test3IiEvP14NSMutableArray
47 // CHECK: @objc_msgSend
50 // CHECK-LABEL: define{{.*}} void @_Z11static_dataP14NSMutableArray
51 void static_data(NSMutableArray *array) {
52 // CHECK: call i32 @__cxa_guard_acquire
53 // CHECK: call noundef ptr @objc_msgSend
54 // CHECK: call void @__cxa_guard_release
55 static id x = array[4];