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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [abi/] [layout2.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
// Red Hat bugzilla 65210
2
// { dg-do run }
3
 
4
struct A {
5
    int a;
6
};
7
 
8
struct B : public virtual A {};
9
 
10
struct C {
11
  long double c;
12
};
13
 
14
struct D : public virtual C {
15
    int d;
16
};
17
 
18
struct E : public B, public D {
19
    int e;
20
};
21
 
22
E e;
23
 
24
/* The layout of E should begin with the B-in-E vtable pointer, followed by
25
   the D-in-E vtable pointer.  The bug was that we used to pad out the D
26
   fields for long double alignment.  */
27
 
28
int main ()
29
{
30
  D* dp = &e;
31
  unsigned long d_offset = ((char*)dp) - ((char*) &e);
32
  return (d_offset != sizeof(void *));
33
}

powered by: WebSVN 2.1.0

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