blob: 5619ab3d3d499d61a81376b96d81a58ecec4a8b3 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fblocks -fobjc-gc -emit-llvm -o %t %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: grep -F '@objc_assign_strongCast' %t | count 4
John McCall260611a2012-06-20 06:18:46 +00003// 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
Fariborz Jahanian27b7aa02010-05-20 18:22:28 +00004// RUN: grep -F '@objc_assign_strongCast' %t | count 4
Fariborz Jahanianfd02ed72009-09-21 18:54:29 +00005
6@interface DSATextSearch @end
7
Fariborz Jahanian27b7aa02010-05-20 18:22:28 +00008DSATextSearch **_uniqueIdToIdentifierArray = (0);
Fariborz Jahanianfd02ed72009-09-21 18:54:29 +00009void foo (int _nextId)
10{
11 _uniqueIdToIdentifierArray[_nextId] = 0; // objc_assign_strongCast
12}
13
14typedef struct {
15 unsigned long state;
16 id *itemsPtr;
17 void (^bp)();
18 unsigned long *mutationsPtr;
19 unsigned long extra[5];
20} NSFastEnumerationState;
21
22void foo1 (NSFastEnumerationState * state)
23{
24 state->itemsPtr = 0;
25 state->bp = ^{};
26}
27