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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/41788
2
// { dg-do run }
3
// { dg-options "-Wpacked -Wno-attributes" }
4
 
5
extern "C" void abort ();
6
 
7
struct INNER {
8
  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.