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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [abi/] [packed1.C] - Rev 399

Compare with Previous | Blame | View Log

// PR c++/41788
// { dg-options "-Wpacked" }
// { dg-do run }

extern "C" void abort ();

struct INNER { // { dg-warning "inefficient.*vptr" "" { target alpha*-*-* ia64-*-* hppa*-*-* sparc*-*-* sh*-*-* or32-*-* } }
  virtual int foo() const { return 1; }
} __attribute__ ((packed));

struct OUTER {
  char c;
  INNER inner;
} __attribute__ ((packed));

int main()
{
  OUTER outer;
  int s = sizeof(outer);
  int o = (char *)&outer.inner - (char *)&outer;
  if (s != sizeof (char) + sizeof (void*)
      || o != sizeof (char))
    abort ();
}

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.