Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s
      2 // RUN: grep objc_assign_ivar %t | count 3
      3 // RUN: grep objc_assign_strongCast %t | count 6
      4 // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s
      5 // RUN: grep objc_assign_ivar %t | count 3
      6 // RUN: grep objc_assign_strongCast %t | count 6
      7 
      8 struct Slice {
      9     void *__strong * items;
     10 };
     11 
     12 typedef struct Slice Slice;
     13 
     14 @interface ISlice {
     15 @public
     16     void *__strong * IvarItem;
     17 }
     18 @end
     19 
     20 typedef void (^observer_block_t)(id object);
     21 @interface Observer  {
     22 @public
     23     observer_block_t block;
     24 }
     25 @end
     26 
     27 
     28 void foo (int i) {
     29     // storing into an array of strong pointer types.
     30     void *__strong* items;
     31     items[i] = 0;
     32 
     33     // storing indirectly into an array of strong pointer types.
     34     void *__strong* *vitems;
     35     *vitems[i] = 0;
     36 
     37     Slice *slice;
     38     slice->items = 0;
     39     // storing into a struct element of an array of strong pointer types.
     40     slice->items[i] = 0;
     41 
     42     ISlice *islice;
     43     islice->IvarItem = 0;
     44     // Storing into an ivar of an array of strong pointer types.
     45     islice->IvarItem[i] = (void*)0;
     46 
     47     Observer *observer;
     48     observer->block = 0;
     49 }
     50