1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -o %t %s
2*f4a2713aSLionel Sambuc // RUN: not grep "_ZN1XaSERK1X" %t
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc extern "C" int printf(...);
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc struct B {
BB7*f4a2713aSLionel Sambuc B() : B1(3.14), B2(3.15), auB2(3.16) {}
8*f4a2713aSLionel Sambuc float B1;
9*f4a2713aSLionel Sambuc float B2;
prB10*f4a2713aSLionel Sambuc void pr() {
11*f4a2713aSLionel Sambuc printf("B1 = %f B2 = %f auB1 = %f\n", B1, B2, auB1);
12*f4a2713aSLionel Sambuc }
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc union {
15*f4a2713aSLionel Sambuc float auB1;
16*f4a2713aSLionel Sambuc float auB2;
17*f4a2713aSLionel Sambuc };
18*f4a2713aSLionel Sambuc };
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc struct M {
MM21*f4a2713aSLionel Sambuc M() : M1(10), M2(11) , auM1(12) {}
22*f4a2713aSLionel Sambuc int M1;
23*f4a2713aSLionel Sambuc int M2;
prM24*f4a2713aSLionel Sambuc void pr() {
25*f4a2713aSLionel Sambuc printf("M1 = %d M2 = %d auM1 = %d auM2 = %d\n", M1, M2, auM1, auM2);
26*f4a2713aSLionel Sambuc }
27*f4a2713aSLionel Sambuc union {
28*f4a2713aSLionel Sambuc int auM1;
29*f4a2713aSLionel Sambuc int auM2;
30*f4a2713aSLionel Sambuc };
31*f4a2713aSLionel Sambuc };
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc struct N : B {
NN34*f4a2713aSLionel Sambuc N() : N1(20), N2(21) {}
35*f4a2713aSLionel Sambuc int N1;
36*f4a2713aSLionel Sambuc int N2;
prN37*f4a2713aSLionel Sambuc void pr() {
38*f4a2713aSLionel Sambuc printf("N1 = %d N2 = %d\n", N1, N2);
39*f4a2713aSLionel Sambuc B::pr();
40*f4a2713aSLionel Sambuc }
41*f4a2713aSLionel Sambuc };
42*f4a2713aSLionel Sambuc
43*f4a2713aSLionel Sambuc struct Q {
QQ44*f4a2713aSLionel Sambuc Q() : Q1(30), Q2(31) {}
45*f4a2713aSLionel Sambuc int Q1;
46*f4a2713aSLionel Sambuc int Q2;
prQ47*f4a2713aSLionel Sambuc void pr() {
48*f4a2713aSLionel Sambuc printf("Q1 = %d Q2 = %d\n", Q1, Q2);
49*f4a2713aSLionel Sambuc }
50*f4a2713aSLionel Sambuc };
51*f4a2713aSLionel Sambuc
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc struct X : M , N {
XX54*f4a2713aSLionel Sambuc X() : d(0.0), d1(1.1), d2(1.2), d3(1.3) {}
55*f4a2713aSLionel Sambuc double d;
56*f4a2713aSLionel Sambuc double d1;
57*f4a2713aSLionel Sambuc double d2;
58*f4a2713aSLionel Sambuc double d3;
prX59*f4a2713aSLionel Sambuc void pr() {
60*f4a2713aSLionel Sambuc printf("d = %f d1 = %f d2 = %f d3 = %f\n", d, d1,d2,d3);
61*f4a2713aSLionel Sambuc M::pr(); N::pr();
62*f4a2713aSLionel Sambuc q1.pr(); q2.pr();
63*f4a2713aSLionel Sambuc }
64*f4a2713aSLionel Sambuc
65*f4a2713aSLionel Sambuc Q q1, q2;
66*f4a2713aSLionel Sambuc };
67*f4a2713aSLionel Sambuc
68*f4a2713aSLionel Sambuc
69*f4a2713aSLionel Sambuc X srcX;
70*f4a2713aSLionel Sambuc X dstX;
71*f4a2713aSLionel Sambuc X dstY;
72*f4a2713aSLionel Sambuc
main()73*f4a2713aSLionel Sambuc int main() {
74*f4a2713aSLionel Sambuc dstY = dstX = srcX;
75*f4a2713aSLionel Sambuc srcX.pr();
76*f4a2713aSLionel Sambuc dstX.pr();
77*f4a2713aSLionel Sambuc dstY.pr();
78*f4a2713aSLionel Sambuc }
79*f4a2713aSLionel Sambuc
80