Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / copy-assign-synthesis.cpp
blob9c8ae8879540e7050d41ffefeb060c6f9fdd60dd
1 // RUN: %clang_cc1 -emit-llvm -o %t %s
2 // RUN: not grep "_ZN1XaSERK1X" %t
4 extern "C" int printf(...);
6 struct B {
7 B() : B1(3.14), B2(3.15), auB2(3.16) {}
8 float B1;
9 float B2;
10 void pr() {
11 printf("B1 = %f B2 = %f auB1 = %f\n", B1, B2, auB1);
14 union {
15 float auB1;
16 float auB2;
20 struct M {
21 M() : M1(10), M2(11) , auM1(12) {}
22 int M1;
23 int M2;
24 void pr() {
25 printf("M1 = %d M2 = %d auM1 = %d auM2 = %d\n", M1, M2, auM1, auM2);
27 union {
28 int auM1;
29 int auM2;
33 struct N : B {
34 N() : N1(20), N2(21) {}
35 int N1;
36 int N2;
37 void pr() {
38 printf("N1 = %d N2 = %d\n", N1, N2);
39 B::pr();
43 struct Q {
44 Q() : Q1(30), Q2(31) {}
45 int Q1;
46 int Q2;
47 void pr() {
48 printf("Q1 = %d Q2 = %d\n", Q1, Q2);
53 struct X : M , N {
54 X() : d(0.0), d1(1.1), d2(1.2), d3(1.3) {}
55 double d;
56 double d1;
57 double d2;
58 double d3;
59 void pr() {
60 printf("d = %f d1 = %f d2 = %f d3 = %f\n", d, d1,d2,d3);
61 M::pr(); N::pr();
62 q1.pr(); q2.pr();
65 Q q1, q2;
66 };
69 X srcX;
70 X dstX;
71 X dstY;
73 int main() {
74 dstY = dstX = srcX;
75 srcX.pr();
76 dstX.pr();
77 dstY.pr();