blob: 182456221c3c8a994efd11c9ec0a272b1dc32b3e [file] [log] [blame]
Ted Kremenekebcb57a2012-03-06 20:05:56 +00001// 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
8id 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
Bill Wendling4e1125f2013-02-22 09:10:20 +000015// CHECK: [[SIX:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[call]]) [[NUW:#[0-9]+]]
John McCall015f33b2012-10-17 02:28:37 +000016// CHECK: [[ARRAY_CASTED:%.*]] = bitcast %0** {{%.*}} to i8**
17// CHECK: call void @objc_storeStrong(i8** [[ARRAY_CASTED]], i8* null)
Bill Wendling4e1125f2013-02-22 09:10:20 +000018// CHECK: [[EIGHT:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[SIX]]) [[NUW]]
Ted Kremenekebcb57a2012-03-06 20:05:56 +000019// CHECK: ret i8* [[EIGHT]]
20
Bill Wendling4e1125f2013-02-22 09:10:20 +000021// CHECK: attributes [[NUW]] = { nounwind }