blob: f1c7dd9a867e543647982be4e0acacc38ca94d4c [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -emit-llvm -o %t
Fariborz Jahanianc238a792009-07-30 00:10:25 +00002
3extern "C" int printf(...);
4
5struct M {
6 M(int i){ iM = i; }
7 int iM;
8 void MPR() { printf("iM = %d\n", iM); }
9
10};
11
12struct Q {
13 Q(int i){ iQ = i; }
14 int iQ;
15 void QPR() { printf("iQ = %d\n", iQ); }
16};
17
18struct IQ {
19 IQ(int i) { iIQ = i; }
20 void IQPR() { printf("iIQ = %d\n", iIQ); }
21 int iIQ;
22};
23
24struct L : IQ {
25 L(int i) : IQ(i+100) { iL = i; }
26 int iL;
27};
28
29struct P : Q, L {
30 P(int i) : Q(i+100), L(i+200) { iP = i; }
31 int iP;
32 void PPR() { printf("iP = %d\n", iP); }
33};
34
35
36struct N : M,P {
37 N() : M(100), P(200) {}
Mike Stump1eb44332009-09-09 15:08:12 +000038 void PR() {
39 this->MPR(); this->PPR(); this->QPR();
40 IQPR();
41 printf("iM = %d\n", iM);
42 printf("iP = %d\n", iP);
43 printf("iQ = %d\n", iQ);
44 printf("iL = %d\n", iL);
45 printf("iIQ = %d\n", iIQ);
46 }
Fariborz Jahanianc238a792009-07-30 00:10:25 +000047};
48
49int main() {
50 N n1;
51 n1.PR();
52}