StmtPrinter: factor out arg printing code to PrintCallArgs
[clang.git] / test / CodeGenObjC / objc2-write-barrier-3.m
blobcb72cc06e55cfeb003abd0db75e2fe3ab1f03ccc
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
8 struct Slice {
9     void *__strong * items;
12 typedef struct Slice Slice;
14 @interface ISlice {
15 @public
16     void *__strong * IvarItem;
18 @end
20 typedef void (^observer_block_t)(id object);
21 @interface Observer  {
22 @public
23     observer_block_t block;
25 @end
28 void foo (int i) {
29     // storing into an array of strong pointer types.
30     void *__strong* items;
31     items[i] = 0;
33     // storing indirectly into an array of strong pointer types.
34     void *__strong* *vitems;
35     *vitems[i] = 0;
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;
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;
47     Observer *observer;
48     observer->block = 0;