Fariborz Jahanian | b4eae11 | 2010-05-21 16:13:37 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix C %s |
| 2 | // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CP %s |
Fariborz Jahanian | 842ddd0 | 2010-05-20 21:38:57 +0000 | [diff] [blame] | 3 | |
| 4 | static int count; |
| 5 | |
| 6 | typedef struct S { |
| 7 | int ii; |
| 8 | } SS; |
| 9 | |
| 10 | struct type_s { |
| 11 | SS may_recurse; |
| 12 | id id_val; |
| 13 | }; |
| 14 | |
| 15 | @interface NamedObject |
| 16 | { |
| 17 | struct type_s type_s_ivar; |
| 18 | } |
| 19 | - (void) setSome : (struct type_s) arg; |
| 20 | - (struct type_s) getSome; |
| 21 | @property(assign) struct type_s aggre_prop; |
| 22 | @end |
| 23 | |
| 24 | @implementation NamedObject |
| 25 | - (void) setSome : (struct type_s) arg |
| 26 | { |
| 27 | type_s_ivar = arg; |
| 28 | } |
| 29 | - (struct type_s) getSome |
| 30 | { |
| 31 | return type_s_ivar; |
| 32 | } |
| 33 | @synthesize aggre_prop = type_s_ivar; |
| 34 | @end |
| 35 | |
| 36 | struct type_s some = {{1234}, (id)0}; |
| 37 | |
| 38 | struct type_s get(void) |
| 39 | { |
| 40 | return some; |
| 41 | } |
| 42 | |
| 43 | void f(const struct type_s *in, struct type_s *out) { |
| 44 | *out = *in; |
| 45 | } |
| 46 | |
Fariborz Jahanian | 0ed5c5d | 2010-05-20 23:34:56 +0000 | [diff] [blame] | 47 | #ifdef __cplusplus |
| 48 | struct Derived : type_s { }; |
| 49 | |
| 50 | void foo(Derived* src, Derived* dest) { |
| 51 | *dest = *src; |
| 52 | } |
Fariborz Jahanian | 0ed5c5d | 2010-05-20 23:34:56 +0000 | [diff] [blame] | 53 | #endif |
| 54 | |
Fariborz Jahanian | b4eae11 | 2010-05-21 16:13:37 +0000 | [diff] [blame] | 55 | // CHECK-C: call i8* @objc_memmove_collectable |
| 56 | // CHECK-C: call i8* @objc_memmove_collectable |
| 57 | // CHECK-C: call i8* @objc_memmove_collectable |
| 58 | |
| 59 | // CHECK-CP: call i8* @objc_memmove_collectable |
| 60 | // CHECK-CP: call i8* @objc_memmove_collectable |
| 61 | // CHECK-CP: call i8* @objc_memmove_collectable |
| 62 | // CHECK-CP: call i8* @objc_memmove_collectable |