Add 32bit time64 syscalls for arm, mips32, ppc32 and x86.
[valgrind.git] / memcheck / tests / malloc3.c
blobdc4ec0868073189064c06f299a4eb2ba089814b1
2 /* test of plausible behaviour with malloc and stupid args */
4 #include <stdlib.h>
5 #include <stdio.h>
7 int main ( void )
9 char* p;
11 p = malloc(0);
12 printf("malloc(0) = 0x%lx\n", (unsigned long)p);
13 free(p);
15 p = malloc(-1);
16 printf("malloc(-1) = 0x%lx\n", (unsigned long)p);
17 free(p);
19 p = calloc(0,1);
20 printf("calloc(0,1) = 0x%lx\n", (unsigned long)p);
21 free(p);
23 p = calloc(0,-1);
24 printf("calloc(0,-1) = 0x%lx\n", (unsigned long)p);
25 free(p);
27 // We no longer get a warning with this due to the calloc overflow checking
28 // done for bug 149878. It's no great loss, it's extremely unlikely to
29 // occur in practice.
30 p = calloc(-1,-1);
31 printf("calloc(-1,-1) = 0x%lx\n", (unsigned long)p);
32 free(p);
34 return 0;