[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CXX / special / class.copy / implicit-move-def.cpp
blob7a6a1ee984e9222f1f81e4bc1dd2276d48bff802
1 // FIXME: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - -std=c++11 %s | FileCheck %s
2 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-ASSIGN %s
3 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-CTOR %s
5 // construct
7 struct E {
8 E();
9 E(E&&);
12 struct F {
13 F();
14 F(F&&);
17 struct G {
18 E e;
21 struct H : G {
22 F l;
23 E m;
24 F ar[2];
27 void f() {
28 H s;
29 // CHECK: call void @_ZN1HC1EOS_
30 H t(static_cast<H&&>(s));
34 // assign
36 struct A {
37 A &operator =(A&&);
40 struct B {
41 B &operator =(B&&);
44 struct C {
45 A a;
48 struct D : C {
49 A a;
50 B b;
51 A ar[2];
54 void g() {
55 D d;
56 // CHECK: call {{.*}} @_ZN1DaSEOS_
57 d = D();
60 // PR10822
61 struct I {
62 unsigned var[1];
65 // CHECK: define void @_Z1hv() nounwind {
66 void h() {
67 I i;
68 // CHECK: call void @llvm.memcpy.
69 i = I();
70 // CHECK-NEXT: ret void
73 // PR10860
74 struct Empty { };
75 struct VirtualWithEmptyBase : Empty {
76 virtual void f();
79 // CHECK: define void @_Z25move_VirtualWithEmptyBaseR20VirtualWithEmptyBaseS0_
80 void move_VirtualWithEmptyBase(VirtualWithEmptyBase &x, VirtualWithEmptyBase &y) {
81 // CHECK: call {{.*}} @_ZN20VirtualWithEmptyBaseaSEOS_
82 x = static_cast<VirtualWithEmptyBase&&>(y);
83 // CHECK-NEXT: ret void
86 // move assignment ops
88 // CHECK-ASSIGN: define linkonce_odr {{.*}} @_ZN1DaSEOS_
89 // CHECK-ASSIGN: call {{.*}} @_ZN1CaSEOS_
90 // CHECK-ASSIGN: call {{.*}} @_ZN1AaSEOS_
91 // CHECK-ASSIGN: call {{.*}} @_ZN1BaSEOS_
92 // array loop
93 // CHECK-ASSIGN: br i1
94 // CHECK-ASSIGN: call {{.*}} @_ZN1AaSEOS_
96 // VirtualWithEmptyBase move assignment operatpr
97 // CHECK-ASSIGN: define linkonce_odr {{.*}} @_ZN20VirtualWithEmptyBaseaSEOS_
98 // CHECK-ASSIGN: store
99 // CHECK-ASSIGN-NEXT: store
100 // CHECK-ASSIGN-NOT: call
101 // CHECK-ASSIGN: ret
103 // CHECK-ASSIGN: define linkonce_odr {{.*}} @_ZN1CaSEOS_
104 // CHECK-ASSIGN: call {{.*}} @_ZN1AaSEOS_
106 // move ctors
108 // CHECK-CTOR: define linkonce_odr {{.*}} @_ZN1HC2EOS_
109 // CHECK-CTOR: call {{.*}} @_ZN1GC2EOS_
110 // CHECK-CTOR: call {{.*}} @_ZN1FC1EOS_
111 // CHECK-CTOR: call {{.*}} @_ZN1EC1EOS_
112 // array loop
113 // CHECK-CTOR: call {{.*}} @_ZN1FC1EOS_
114 // CHECK-CTOR: br i1
116 // CHECK-CTOR: define linkonce_odr {{.*}} @_ZN1GC2EOS_
117 // CHECK-CTOR: call {{.*}} @_ZN1EC1EOS_