xref: /llvm-project/clang/test/CodeGenObjCXX/arc-returns-inner-reference-ptr.mm (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -o - %s | FileCheck %s
2
3@interface Test58
4- (char* &) interior __attribute__((objc_returns_inner_pointer));
5- (int&)reference_to_interior_int __attribute__((objc_returns_inner_pointer));
6@end
7
8void foo() {
9   Test58 *ptr;
10   char *c = [(ptr) interior];
11
12   int i = [(ptr) reference_to_interior_int];
13}
14
15// CHECK: [[T0:%.*]] = load {{.*}} {{%.*}}, align 8
16// call ptr @llvm.objc.retainAutorelease(ptr [[T0]]) nounwind
17// CHECK: [[T2:%.*]] = load {{.*}} {{%.*}}, align 8
18// call ptr @llvm.objc.retainAutorelease(ptr [[T2]]) nounwind
19
20