blob: 896645c3ebfdb144adbc8a4a6cfe30b945b87b7f [file] [log] [blame]
sewardj30594422002-04-24 11:44:27 +00001
2/* test of plausible behaviour with malloc and stupid args */
3
4#include <stdlib.h>
5#include <stdio.h>
6
7int main ( void )
8{
9 char* p;
10
11 p = malloc(0);
12 printf("malloc(0) = %p\n", p);
13 free(p);
14
15 p = malloc(-1);
16 printf("malloc(-1) = %p\n", p);
17 free(p);
18
19 p = calloc(0,1);
20 printf("calloc(0,1) = %p\n", p);
21 free(p);
22
23 p = calloc(0,-1);
24 printf("calloc(0,-1) = %p\n", p);
25 free(p);
26
27 p = calloc(-1,-1);
28 printf("calloc(-1,-1) = %p\n", p);
29 free(p);
30
31 return 0;
32}