Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - -triple=i686-linux-gnu | FileCheck %s
      2 
      3 struct A {
      4   A(const A&);
      5   A &operator=(const A&);
      6 };
      7 
      8 struct B {
      9   A a;
     10   B(B&&) = default;
     11   B &operator=(B&&) = default;
     12 };
     13 
     14 // CHECK: define {{.*}} @_Z2f1
     15 void f1(B &x) {
     16   // CHECK-NOT: memcpy
     17   // CHECK: call {{.*}} @_ZN1BC1EOS_(
     18   B b(static_cast<B&&>(x));
     19 }
     20 
     21 // CHECK: define {{.*}} @_Z2f2
     22 void f2(B &x, B &y) {
     23   // CHECK-NOT: memcpy
     24   // CHECK: call {{.*}} @_ZN1BaSEOS_(
     25   x = static_cast<B&&>(y);
     26 }
     27 
     28 // CHECK: define {{.*}} @_ZN1BaSEOS_(
     29 // CHECK: call {{.*}} @_ZN1AaSERKS_(
     30 
     31 // CHECK: define {{.*}} @_ZN1BC2EOS_(
     32 // CHECK: call {{.*}} @_ZN1AC1ERKS_(
     33