~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to tests/cris/check_mapbrk.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2008-08-25 04:38:35 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080825043835-8e3tftavy8bujdch
Tags: 0.9.1-6
[ Aurelien Jarno ]
* debian/control: 
  - Update list of supported targets (Closes: bug#488339).
* debian/qemu-make-debian-root:
  - Use mktemp instead of $$ to create temporary directories (Closes: 
    bug#496394).
* debian/links:
  - Add missing links to manpages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#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
}