Home | History | Annotate | Download | only in CodeGenObjCXX
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s
      2 
      3 // rdar://problem/9158302
      4 // This should not use a memmove_collectable in non-GC mode.
      5 namespace test0 {
      6   struct A {
      7     id x;
      8   };
      9 
     10   // CHECK:    define [[A:%.*]]* @_ZN5test04testENS_1AE(
     11   // CHECK:      alloca
     12   // CHECK-NEXT: getelementptr
     13   // CHECK-NEXT: store
     14   // CHECK-NEXT: call noalias i8* @_Znwm(
     15   // CHECK-NEXT: bitcast
     16   // CHECK-NEXT: bitcast
     17   // CHECK-NEXT: call void @llvm.memset.p0i8.i64(
     18   // CHECK-NEXT: bitcast
     19   // CHECK-NEXT: bitcast
     20   // CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(
     21   // CHECK-NEXT: ret
     22   A *test(A a) {
     23     return new A(a);
     24   }
     25 }
     26 
     27 
     28 // rdar://9780211
     29 @protocol bork
     30 @end
     31 
     32 namespace test1 {
     33 template<typename T> struct RetainPtr {
     34   RetainPtr() {}
     35 };
     36 
     37 
     38 RetainPtr<id<bork> > x;
     39 RetainPtr<id> y;
     40 
     41 }
     42