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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [abi/] [layout2.C] - Rev 823

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

// Red Hat bugzilla 65210
// { dg-do run }

struct A {
    int a;
};

struct B : public virtual A {};

struct C {
  long double c;
};

struct D : public virtual C {
    int d;
};

struct E : public B, public D {
    int e;
};

E e;

/* The layout of E should begin with the B-in-E vtable pointer, followed by
   the D-in-E vtable pointer.  The bug was that we used to pad out the D
   fields for long double alignment.  */

int main ()
{
  D* dp = &e;
  unsigned long d_offset = ((char*)dp) - ((char*) &e);
  return (d_offset != sizeof(void *));
}

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

powered by: WebSVN 2.1.0

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