xref: /aosp_15_r20/external/clang/test/CodeGenObjC/objc2-strong-cast-block-import.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc-only -fblocks  -emit-llvm -o - %s | FileCheck %s
2*67e74705SXin Li// rdar://10150823
3*67e74705SXin Li
4*67e74705SXin Li@interface Test {
5*67e74705SXin Li@package
6*67e74705SXin Li    Test ** __strong objects;
7*67e74705SXin Li}
8*67e74705SXin Li@end
9*67e74705SXin Li
10*67e74705SXin Liid newObject();
11*67e74705SXin Livoid runWithBlock(void(^)(int i));
12*67e74705SXin Li
13*67e74705SXin Li@implementation Test
14*67e74705SXin Li
15*67e74705SXin Li- (void)testWithObjectInBlock {
16*67e74705SXin Li    Test **children = objects;
17*67e74705SXin Li    runWithBlock(^(int i){
18*67e74705SXin Li        children[i] = newObject();
19*67e74705SXin Li    });
20*67e74705SXin Li}
21*67e74705SXin Li
22*67e74705SXin Li@end
23*67e74705SXin Li// CHECK: call i8* @objc_assign_strongCast
24*67e74705SXin Li// CHECK: call i8* @objc_assign_strongCast
25*67e74705SXin Li
26