Fariborz Jahanian | 842ddd0 | 2010-05-20 21:38:57 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s |
| 2 | // RUN: grep objc_memmove_collectable %t | grep call | count 3 |
| 3 | // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s |
| 4 | // RUN: grep objc_memmove_collectable %t | grep call | count 3 |
| 5 | |
| 6 | static int count; |
| 7 | |
| 8 | typedef struct S { |
| 9 | int ii; |
| 10 | } SS; |
| 11 | |
| 12 | struct type_s { |
| 13 | SS may_recurse; |
| 14 | id id_val; |
| 15 | }; |
| 16 | |
| 17 | @interface NamedObject |
| 18 | { |
| 19 | struct type_s type_s_ivar; |
| 20 | } |
| 21 | - (void) setSome : (struct type_s) arg; |
| 22 | - (struct type_s) getSome; |
| 23 | @property(assign) struct type_s aggre_prop; |
| 24 | @end |
| 25 | |
| 26 | @implementation NamedObject |
| 27 | - (void) setSome : (struct type_s) arg |
| 28 | { |
| 29 | type_s_ivar = arg; |
| 30 | } |
| 31 | - (struct type_s) getSome |
| 32 | { |
| 33 | return type_s_ivar; |
| 34 | } |
| 35 | @synthesize aggre_prop = type_s_ivar; |
| 36 | @end |
| 37 | |
| 38 | struct type_s some = {{1234}, (id)0}; |
| 39 | |
| 40 | struct type_s get(void) |
| 41 | { |
| 42 | return some; |
| 43 | } |
| 44 | |
| 45 | void f(const struct type_s *in, struct type_s *out) { |
| 46 | *out = *in; |
| 47 | } |
| 48 | |