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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [cris/] [c/] [mremap.c] - Blame information for rev 227

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
#include <stdio.h>
2
#include <stdlib.h>
3
 
4
/* Sanity check that system calls for realloc works.  Also tests a few
5
   more cases for mmap2 and munmap.  */
6
 
7
int main ()
8
{
9
  void *p1, *p2;
10
 
11
  if ((p1 = malloc (8100)) == NULL
12
      || (p1 = realloc (p1, 16300)) == NULL
13
      || (p1 = realloc (p1, 4000)) == NULL
14
      || (p1 = realloc (p1, 500)) == NULL
15
      || (p1 = realloc (p1, 1023*1024)) == NULL
16
      || (p1 = realloc (p1, 8191*1024)) == NULL
17
      || (p1 = realloc (p1, 512*1024)) == NULL
18
      || (p2 = malloc (1023*1024)) == NULL
19
      || (p1 = realloc (p1, 1023*1024)) == NULL
20
      || (p1 = realloc (p1, 8191*1024)) == NULL
21
      || (p1 = realloc (p1, 512*1024)) == NULL)
22
  {
23
    printf ("fail\n");
24
    exit (1);
25
  }
26
 
27
  free (p1);
28
  free (p2);
29
  printf ("pass\n");
30
  exit (0);
31
}

powered by: WebSVN 2.1.0

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