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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ipa-sra-2.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 688 jeremybenn
struct big
2
{
3
  int data[1000000];
4
};
5
 
6
struct small
7
{
8
  int data[10];
9
};
10
 
11
union both
12
{
13
  struct big big;
14
  struct small small;
15
};
16
 
17
extern void *calloc (__SIZE_TYPE__, __SIZE_TYPE__);
18
extern void free (void *);
19
 
20
static int __attribute__((noinline))
21
foo (int fail, union both *agg)
22
{
23
  int r;
24
  if (fail)
25
    r = agg->big.data[999999];
26
  else
27
    r = agg->small.data[0];
28
  return r;
29
}
30
 
31
int main (int argc, char *argv[])
32
{
33
  union both *agg = calloc (1, sizeof (struct small));
34
  int r;
35
 
36
  r = foo ((argc > 2000), agg);
37
 
38
  free (agg);
39
  return r;
40
}

powered by: WebSVN 2.1.0

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