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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [cris/] [c/] [mremap.c] - Rev 816

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

#include <stdio.h>
#include <stdlib.h>
 
/* Sanity check that system calls for realloc works.  Also tests a few
   more cases for mmap2 and munmap.  */
 
int main ()
{
  void *p1, *p2;
 
  if ((p1 = malloc (8100)) == NULL
      || (p1 = realloc (p1, 16300)) == NULL
      || (p1 = realloc (p1, 4000)) == NULL
      || (p1 = realloc (p1, 500)) == NULL
      || (p1 = realloc (p1, 1023*1024)) == NULL
      || (p1 = realloc (p1, 8191*1024)) == NULL
      || (p1 = realloc (p1, 512*1024)) == NULL
      || (p2 = malloc (1023*1024)) == NULL
      || (p1 = realloc (p1, 1023*1024)) == NULL
      || (p1 = realloc (p1, 8191*1024)) == NULL
      || (p1 = realloc (p1, 512*1024)) == NULL)
  {
    printf ("fail\n");
    exit (1);
  }
 
  free (p1);
  free (p2);
  printf ("pass\n");
  exit (0);
}
 

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

powered by: WebSVN 2.1.0

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