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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [cris/] [c/] [mapbrk.c] - Blame information for rev 157

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
#include <stdio.h>
2
#include <stdlib.h>
3
 
4
/* Basic sanity check that syscalls to implement malloc (brk, mmap2,
5
   munmap) are trivially functional.  */
6
 
7
int main ()
8
{
9
  void *p1, *p2, *p3, *p4, *p5, *p6;
10
 
11
  if ((p1 = malloc (8100)) == NULL
12
      || (p2 = malloc (16300)) == NULL
13
      || (p3 = malloc (4000)) == NULL
14
      || (p4 = malloc (500)) == NULL
15
      || (p5 = malloc (1023*1024)) == NULL
16
      || (p6 = malloc (8191*1024)) == NULL)
17
  {
18
    printf ("fail\n");
19
    exit (1);
20
  }
21
 
22
  free (p1);
23
  free (p2);
24
  free (p3);
25
  free (p4);
26
  free (p5);
27
  free (p6);
28
 
29
  p1 = malloc (64000);
30
  if (p1 == NULL)
31
  {
32
    printf ("fail\n");
33
    exit (1);
34
  }
35
  free (p1);
36
 
37
  printf ("pass\n");
38
  exit (0);
39
}

powered by: WebSVN 2.1.0

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