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] - Blame information for rev 399

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/41788
2
// { dg-options "-Wpacked" }
3
// { dg-do run }
4
 
5
extern "C" void abort ();
6
 
7 399 jeremybenn
struct INNER { // { dg-warning "inefficient.*vptr" "" { target alpha*-*-* ia64-*-* hppa*-*-* sparc*-*-* sh*-*-* or32-*-* } }
8 301 jeremybenn
  virtual int foo() const { return 1; }
9
} __attribute__ ((packed));
10
 
11
struct OUTER {
12
  char c;
13
  INNER inner;
14
} __attribute__ ((packed));
15
 
16
int main()
17
{
18
  OUTER outer;
19
  int s = sizeof(outer);
20
  int o = (char *)&outer.inner - (char *)&outer;
21
  if (s != sizeof (char) + sizeof (void*)
22
      || o != sizeof (char))
23
    abort ();
24
}

powered by: WebSVN 2.1.0

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