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/] [gcc.c-torture/] [execute/] [strct-pack-3.c] - Blame information for rev 301

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

Line No. Rev Author Line
1 297 jeremybenn
typedef struct
2
{
3
  short i __attribute__ ((aligned (2),packed));
4
  int f[2] __attribute__ ((aligned (2),packed));
5
} A;
6
 
7
f (ap)
8
  A *ap;
9
{
10
  short i, j = 1;
11
 
12
  i = ap->f[1];
13
  i += ap->f[j];
14
  for (j = 0; j < 2; j++)
15
    i += ap->f[j];
16
 
17
  return i;
18
}
19
 
20
main ()
21
{
22
  A a;
23
  a.f[0] = 100;
24
  a.f[1] = 13;
25
  if (f (&a) != 139)
26
    abort ();
27
  exit (0);
28
}

powered by: WebSVN 2.1.0

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