tap: invoke downscript when we exit abnormally
[qemu.git] / tests / cris / check_mapbrk.c
blob1aff7622bc2adfca206e394023a6198512fab0df
1 #include <stdio.h>
2 #include <stdlib.h>
4 /* Basic sanity check that syscalls to implement malloc (brk, mmap2,
5 munmap) are trivially functional. */
7 int main ()
9 void *p1, *p2, *p3, *p4, *p5, *p6;
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)
18 printf ("fail\n");
19 exit (1);
22 free (p1);
23 free (p2);
24 free (p3);
25 free (p4);
26 free (p5);
27 free (p6);
29 p1 = malloc (64000);
30 if (p1 == NULL)
32 printf ("fail\n");
33 exit (1);
35 free (p1);
37 printf ("pass\n");
38 exit (0);