xref: /aosp_15_r20/external/clang/test/CodeGenObjC/objc2-new-gc-api-strongcast.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fblocks -fobjc-gc -emit-llvm -o %t %s
2*67e74705SXin Li// RUN: grep -F '@objc_assign_strongCast' %t  | count 4
3*67e74705SXin Li// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fblocks -fobjc-gc -emit-llvm -o %t %s
4*67e74705SXin Li// RUN: grep -F '@objc_assign_strongCast' %t  | count 4
5*67e74705SXin Li
6*67e74705SXin Li@interface DSATextSearch @end
7*67e74705SXin Li
8*67e74705SXin LiDSATextSearch **_uniqueIdToIdentifierArray = (0);
9*67e74705SXin Livoid foo (int _nextId)
10*67e74705SXin Li{
11*67e74705SXin Li	_uniqueIdToIdentifierArray[_nextId] = 0;  // objc_assign_strongCast
12*67e74705SXin Li}
13*67e74705SXin Li
14*67e74705SXin Litypedef struct {
15*67e74705SXin Li    unsigned long state;
16*67e74705SXin Li    id *itemsPtr;
17*67e74705SXin Li    void (^bp)();
18*67e74705SXin Li    unsigned long *mutationsPtr;
19*67e74705SXin Li    unsigned long extra[5];
20*67e74705SXin Li} NSFastEnumerationState;
21*67e74705SXin Li
22*67e74705SXin Livoid foo1 (NSFastEnumerationState * state)
23*67e74705SXin Li{
24*67e74705SXin Li   state->itemsPtr = 0;
25*67e74705SXin Li   state->bp = ^{};
26*67e74705SXin Li}
27*67e74705SXin Li
28