[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCXX / cxx11-special-members.cpp
blobf67acaa4565022926d0de9923f382e9c6172be27
1 // RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - -triple=i686-linux-gnu | FileCheck %s
3 struct A {
4 A(const A&);
5 A &operator=(const A&);
6 };
8 struct B {
9 A a;
10 B(B&&) = default;
11 B &operator=(B&&) = default;
14 // CHECK: define {{.*}} @_Z2f1
15 void f1(B &x) {
16 // CHECK-NOT: memcpy
17 // CHECK: call {{.*}} @_ZN1BC1EOS_(
18 B b(static_cast<B&&>(x));
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);
28 // CHECK: define {{.*}} @_ZN1BaSEOS_(
29 // CHECK: call {{.*}} @_ZN1AaSERKS_(
31 template<int> struct C { C() = default; };
32 struct D {
33 C<0> c;
34 D() { }
36 template struct C<0>; // was asserting
37 void f3() {
38 C<0> a;
39 D b;
41 // Trivial default ctor, might or might not be defined, but we must not expect
42 // someone else to define it.
43 // CHECK-NOT: declare {{.*}} @_ZN1CILi0EEC1Ev
44 // CHECK: define {{.*}} @_ZN1DC1Ev
46 // CHECK: define {{.*}} @_ZN1BC2EOS_(
47 // CHECK: call {{.*}} @_ZN1AC1ERKS_(