OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [net17.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// example from the ARM page 292 and 293
3
 
4
extern "C" int printf(const char *, ...);
5
extern "C" void exit(int);
6
 
7
int i = 0;
8
 
9
class A {
10
public:
11
  A() {
12
    printf("Doing A\n");
13
    if (++i != 1)
14
      exit(1);
15
  }
16
};
17
 
18
class B {
19
public:
20
  B() {
21
    printf("Doing B\n");
22
    if (++i != 2)
23
      exit(1);
24
  }
25
};
26
 
27
class C : public virtual A, public virtual B {
28
public:
29
  C() {
30
    printf("Doing C\n");
31
    if (++i != 3)
32
      exit(1);
33
  }
34
};
35
 
36
class D : public virtual B, public virtual A {
37
public:
38
  D() {
39
    printf("Doing D\n");
40
    if (++i != 4)
41
      exit(1);
42
  }
43
};
44
 
45
class E : public C, public D {
46
public:
47
  E() {
48
    printf("Doing E\n");
49
    if (++i != 5)
50
      exit(1);
51
  }
52
} e;
53
 
54
 
55
int main() {
56
  if (++i != 6)
57
    exit(1);
58
  return 0;
59
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.