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 320
Go to most recent revision | 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*-*-* } }
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