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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [abi/] [packed1.C] - Rev 694

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

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

extern "C" void abort ();

struct INNER {
  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 ();
}

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.