Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -fobjc-arc -emit-llvm -triple x86_64-apple-darwin -o - %s | FileCheck %s
      2 
      3 @interface NSMutableArray
      4 - (id)objectAtIndexedSubscript:(int)index;
      5 - (void)setObject:(id)object atIndexedSubscript:(int)index;
      6 @end
      7 
      8 id func() {
      9   NSMutableArray *array;
     10   array[3] = 0;
     11   return array[3];
     12 }
     13 
     14 // CHECK: [[call:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
     15 // CHECK: [[SIX:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[call]]) [[NUW:#[0-9]+]]
     16 // CHECK: [[ARRAY_CASTED:%.*]] = bitcast %0** {{%.*}} to i8**
     17 // CHECK: call void @objc_storeStrong(i8** [[ARRAY_CASTED]], i8* null)
     18 // CHECK: [[EIGHT:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[SIX]]) [[NUW]]
     19 // CHECK: ret i8* [[EIGHT]]
     20 
     21 // CHECK: attributes [[NUW]] = { nounwind }
     22