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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr45699.C] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
 
3
extern "C" void abort ();
4
 
5
class A
6
{
7
public:
8
  virtual void foo () {abort();}
9
};
10
 
11
class B : public A
12
{
13
public:
14
  int z;
15
  virtual void foo () {abort();}
16
};
17
 
18
class C : public A
19
{
20
public:
21
  void *a[32];
22
  unsigned long b;
23
  long c[32];
24
 
25
  virtual void foo () {abort();}
26
};
27
 
28
class D : public C, public B
29
{
30
public:
31
  D () : C(), B()
32
  {
33
    int i;
34
    for (i = 0; i < 32; i++)
35
      {
36
        a[i] = (void *) 0;
37
        c[i] = 0;
38
      }
39
    b = 0xaaaa;
40
  }
41
 
42
  virtual void foo ();
43
};
44
 
45
void D::foo()
46
{
47
  if (b != 0xaaaa)
48
    abort();
49
}
50
 
51
static inline void bar (B &b)
52
{
53
  b.foo ();
54
}
55
 
56
int main()
57
{
58
  D d;
59
  bar (d);
60
  return 0;
61
}

powered by: WebSVN 2.1.0

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