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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr43784.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
struct s {
2
  unsigned char a[256];
3
};
4
union u {
5
  struct { struct s b; int c; } d;
6
  struct { int c; struct s b; } e;
7
};
8
 
9
static union u v;
10
static struct s *p = &v.d.b;
11
static struct s *q = &v.e.b;
12
 
13
static struct s __attribute__((noinline)) rp(void)
14
{
15
  return *p;
16
}
17
 
18
static void qp(void)
19
{
20
  *q = rp();
21
}
22
 
23
int main()
24
{
25
  int i;
26
  for (i = 0; i < 256; i++)
27
    p->a[i] = i;
28
  qp();
29
  for (i = 0; i < 256; i++)
30
    if (q->a[i] != i)
31
      __builtin_abort();
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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