xref: /llvm-project/clang/test/CodeGenObjCXX/arc-rv-attr.mm (revision 9466b49171dc4b21f56a48594fc82b1e52f5358a)
1// RUN: %clang_cc1 -triple arm64-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -std=c++11 -O -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK
2
3id foo(void);
4
5// CHECK-LABEL: define{{.*}} void @_Z14test_list_initv(
6// CHECK: %[[CALL1:.*]] = call noundef ptr @_Z3foov() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
7// CHECK: call ptr @llvm.objc.retain(ptr %[[CALL1]])
8
9void test_list_init() {
10  auto t = id{foo()};
11}
12