Home | History | Annotate | Download | only in CodeGenObjCXX
      1 // RUN: %clang_cc1 -fobjc-gc -emit-llvm -triple x86_64-apple-darwin10.0.0 -o - %s | FileCheck %s
      2 struct A { 
      3   A &operator=(const A&);
      4   A &operator=(A&);
      5 };
      6 
      7 struct B {
      8   B &operator=(B&);
      9 };
     10 
     11 struct C {
     12   virtual C& operator=(const C&);
     13 };
     14 
     15 struct POD {
     16   id myobjc;
     17   int array[3][4];
     18 };
     19 
     20 struct CopyByValue {
     21   CopyByValue(const CopyByValue&);
     22   CopyByValue &operator=(CopyByValue);
     23 };
     24 
     25 struct D : A, B, virtual C { 
     26   int scalar;
     27   int scalar_array[2][3];
     28   B class_member;
     29   C class_member_array[2][3];
     30   POD pod_array[2][3];
     31 
     32   union {
     33     int x;
     34     float f[3];
     35   };
     36 
     37   CopyByValue by_value;
     38 };
     39 
     40 void test_D(D d1, D d2) {
     41   d1 = d2;
     42 }
     43 
     44 // CHECK: define linkonce_odr %struct.D* @_ZN1DaSERS_
     45 // CHECK: {{call.*_ZN1AaSERS_}}
     46 // CHECK: {{call.*_ZN1BaSERS_}}
     47 // CHECK: {{call.*_ZN1CaSERKS_}}
     48 // CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
     49 // CHECK: {{call.*_ZN1BaSERS_}}
     50 // CHECK: br
     51 // CHECK: {{call.*_ZN1CaSERKS_}}
     52 // CHECK: {{call.*@objc_memmove_collectable}}
     53 // CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
     54 // CHECK: call void @_ZN11CopyByValueC1ERKS_
     55 // CHECK: {{call.*_ZN11CopyByValueaSES_}}
     56 // CHECK: ret
     57 
     58