blob: 350b2b0beda6df37ea59eac899b3f12e029c18d0 [file] [log] [blame]
Fariborz Jahanianac423ba2009-09-08 19:45:47 +00001// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
Fariborz Jahanian7f4f86a2009-09-08 23:38:54 +00002// RUN: grep objc_assign_strongCast %t | count 7 &&
Fariborz Jahanianac423ba2009-09-08 19:45:47 +00003// RUN: true
4
5struct Slice {
6 void *__strong * items;
7};
8
9typedef struct Slice Slice;
10
11@interface ISlice {
12@public
Fariborz Jahanian7f4f86a2009-09-08 23:38:54 +000013 void *__strong * IvarItem;
Fariborz Jahanianac423ba2009-09-08 19:45:47 +000014}
15@end
16
Fariborz Jahanian7f4f86a2009-09-08 23:38:54 +000017void foo (int i) {
18 // storing into an array of strong pointer types.
19 void *__strong* items;
20 items[i] = 0;
21
22 // storing indirectly into an array of strong pointer types.
23 void *__strong* *vitems;
24 *vitems[i] = 0;
25
Fariborz Jahanianac423ba2009-09-08 19:45:47 +000026 Slice *slice;
27 slice->items = 0;
Fariborz Jahanian7f4f86a2009-09-08 23:38:54 +000028 // storing into a struct element of an array of strong pointer types.
29 slice->items[i] = 0;
Fariborz Jahanianac423ba2009-09-08 19:45:47 +000030
31 ISlice *islice;
Fariborz Jahanian7f4f86a2009-09-08 23:38:54 +000032 islice->IvarItem = 0;
33 // Storing into an ivar of an array of strong pointer types.
34 islice->IvarItem[i] = (void*)0;
Fariborz Jahanianac423ba2009-09-08 19:45:47 +000035}