1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s |
2 | // RUN: not grep objc_assign_ivar %t |
3 | // RUN: grep objc_assign_strongCast %t | count 8 |
4 | // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s |
5 | // RUN: not grep objc_assign_ivar %t |
6 | // RUN: grep objc_assign_strongCast %t | count 8 |
7 | |
8 | @interface TestUnarchiver |
9 | { |
10 | void *allUnarchivedObjects; |
11 | } |
12 | @end |
13 | |
14 | @implementation TestUnarchiver |
15 | |
16 | struct unarchive_list { |
17 | int ifield; |
18 | id *list; |
19 | }; |
20 | |
21 | - (id)init { |
22 | (*((struct unarchive_list *)allUnarchivedObjects)).list = 0; |
23 | ((struct unarchive_list *)allUnarchivedObjects)->list = 0; |
24 | (**((struct unarchive_list **)allUnarchivedObjects)).list = 0; |
25 | (*((struct unarchive_list **)allUnarchivedObjects))->list = 0; |
26 | return 0; |
27 | } |
28 | |
29 | @end |
30 | |
31 | // rdar://10191569 |
32 | @interface I |
33 | { |
34 | struct S { |
35 | id _timer; |
36 | } *p_animationState; |
37 | } |
38 | @end |
39 | |
40 | @implementation I |
41 | - (void) Meth { |
42 | p_animationState->_timer = 0; |
43 | (*p_animationState)._timer = 0; |
44 | (&(*p_animationState))->_timer = 0; |
45 | } |
46 | @end |
47 | |