brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 3b46588 Raw
63 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-C %s2// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-CP %s3 4static int count;5 6typedef struct S {7   int ii;8} SS;9 10struct type_s {11   SS may_recurse;12   id id_val;13};14 15@interface NamedObject16{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@end23 24@implementation NamedObject 25- (void) setSome : (struct type_s) arg26  {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@end35 36struct type_s some = {{1234}, (id)0};37 38struct type_s get(void)39{40  return some;41}42 43void f(const struct type_s *in, struct type_s *out) {44  *out = *in;45}46 47#ifdef __cplusplus48struct Derived : type_s { };49 50void foo(Derived* src, Derived* dest) {51        *dest = *src;52}53#endif54 55// CHECK-C: call ptr @objc_memmove_collectable56// CHECK-C: call ptr @objc_memmove_collectable57// CHECK-C: call ptr @objc_memmove_collectable58 59// CHECK-CP: call ptr @objc_memmove_collectable60// CHECK-CP: call ptr @objc_memmove_collectable61// CHECK-CP: call ptr @objc_memmove_collectable62// CHECK-CP: call ptr @objc_memmove_collectable63