John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s |
Rafael Espindola | d029cbb | 2013-07-04 15:22:16 +0000 | [diff] [blame] | 2 | // RUN: not grep objc_assign_ivar %t |
Fariborz Jahanian | ccae76c | 2011-09-30 18:23:36 +0000 | [diff] [blame] | 3 | // RUN: grep objc_assign_strongCast %t | count 8 |
John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 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 |
Rafael Espindola | d029cbb | 2013-07-04 15:22:16 +0000 | [diff] [blame] | 5 | // RUN: not grep objc_assign_ivar %t |
Fariborz Jahanian | ccae76c | 2011-09-30 18:23:36 +0000 | [diff] [blame] | 6 | // RUN: grep objc_assign_strongCast %t | count 8 |
Fariborz Jahanian | 75b08f1 | 2009-09-30 17:10:29 +0000 | [diff] [blame] | 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 |
Fariborz Jahanian | ccae76c | 2011-09-30 18:23:36 +0000 | [diff] [blame] | 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 |