brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 4ef1b8a Raw
50 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s2// RUN: grep objc_assign_ivar %t | count 33// RUN: grep objc_assign_strongCast %t | count 64// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s5// RUN: grep objc_assign_ivar %t | count 36// RUN: grep objc_assign_strongCast %t | count 67 8struct Slice {9    void *__strong * items;10};11 12typedef struct Slice Slice;13 14@interface ISlice {15@public16    void *__strong * IvarItem;17}18@end19 20typedef void (^observer_block_t)(id object);21@interface Observer  {22@public23    observer_block_t block;24}25@end26 27 28void 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