blob: 626083b1c42d50676dcd6532b29ff19a70afedaa [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// 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
5struct Slice {
6 void *__strong * items;
7};
8
9typedef struct Slice Slice;
10
11@interface ISlice {
12@public
13 void *__strong * IvarItem;
14}
15@end
16
17typedef void (^observer_block_t)(id object);
18@interface Observer {
19@public
20 observer_block_t block;
21}
22@end
23
24
25void foo (int i) {
26 // storing into an array of strong pointer types.
27 void *__strong* items;
28 items[i] = 0;
29
30 // storing indirectly into an array of strong pointer types.
31 void *__strong* *vitems;
32 *vitems[i] = 0;
33
34 Slice *slice;
35 slice->items = 0;
36 // storing into a struct element of an array of strong pointer types.
37 slice->items[i] = 0;
38
39 ISlice *islice;
40 islice->IvarItem = 0;
41 // Storing into an ivar of an array of strong pointer types.
42 islice->IvarItem[i] = (void*)0;
43
44 Observer *observer;
45 observer->block = 0;
46}