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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ipa/] [pr46287-1.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
// Check that indirect calls to thunks do not lead to errors.
2
// { dg-do run }
3
// { dg-options "-O" }
4
 
5
extern "C" void abort ();
6
 
7
class A
8
{
9
public:
10
  virtual void foo () {abort();}
11
};
12
 
13
class B : public A
14
{
15
public:
16
  int z;
17
  virtual void foo () {abort();}
18
};
19
 
20
class C : public A
21
{
22
public:
23
  void *a[32];
24
  unsigned long b;
25
  long c[32];
26
 
27
  virtual void foo () {abort();}
28
};
29
 
30
class D : public C, public B
31
{
32
public:
33
  D () : C(), B()
34
  {
35
    int i;
36
    for (i = 0; i < 32; i++)
37
      {
38
        a[i] = (void *) 0;
39
        c[i] = 0;
40
      }
41
    b = 0xaaaa;
42
  }
43
 
44
  virtual void foo ();
45
};
46
 
47
inline void D::foo()
48
{
49
  if (b != 0xaaaa)
50
    abort();
51
}
52
 
53
static inline void bar (B &b)
54
{
55
 
56
  b.foo ();
57
}
58
 
59
int main()
60
{
61
  int i;
62
  D d;
63
 
64
  for (i = 0; i < 5000; i++)
65
    bar (d);
66
  return 0;
67
}

powered by: WebSVN 2.1.0

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