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++.dg/] [abi/] [layout1.C] - Diff between revs 301 and 338

Only display areas with differences | Details | Blame | View Log

Rev 301 Rev 338
// Red Hat bugzilla 64535
// Red Hat bugzilla 64535
// Bug: We are allocationg stuff into the tail padding of POD class "A".
// Bug: We are allocationg stuff into the tail padding of POD class "A".
// { dg-do run }
// { dg-do run }
struct A
struct A
{
{
  int x;
  int x;
  char y;
  char y;
};
};
struct B : public A {
struct B : public A {
  virtual void f () {}
  virtual void f () {}
  char z;
  char z;
};
};
A a = { 21, 42 };
A a = { 21, 42 };
B b;
B b;
int
int
main (void)
main (void)
{
{
  b.x = 12;
  b.x = 12;
  b.y = 24;
  b.y = 24;
  b.z = 36;
  b.z = 36;
  A *ap = &b;
  A *ap = &b;
  *ap = a;
  *ap = a;
  return (b.z != 36);
  return (b.z != 36);
}
}
 
 

powered by: WebSVN 2.1.0

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