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