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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [960521-1.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
#include <stdlib.h>
2
 
3
int *a, *b;
4
int n;
5
 
6
#ifdef STACK_SIZE
7
#define BLOCK_SIZE (STACK_SIZE / (sizeof (*a) + sizeof (*b)))
8
#else
9
#define BLOCK_SIZE 32768
10
#endif
11
foo ()
12
{
13
  int i;
14
  for (i = 0; i < n; i++)
15
    a[i] = -1;
16
  for (i = 0; i < BLOCK_SIZE - 1; i++)
17
    b[i] = -1;
18
}
19
 
20
main ()
21
{
22
  n = BLOCK_SIZE;
23
  a = malloc (n * sizeof(*a));
24
  b = malloc (n * sizeof(*b));
25
  *b++ = 0;
26
  foo ();
27
  if (b[-1])
28
    abort ();
29
  exit (0);
30
}

powered by: WebSVN 2.1.0

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