~ubuntu-branches/ubuntu/wily/qemu-kvm-spice/wily

« back to all changes in this revision

Viewing changes to tests/cris/check_mapbrk.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-10-19 10:44:56 UTC
  • Revision ID: james.westby@ubuntu.com-20111019104456-xgvskumk3sxi97f4
Tags: upstream-0.15.0+noroms
ImportĀ upstreamĀ versionĀ 0.15.0+noroms

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
}