mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
Various minor changes to make these compile on AIX5. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6254
33 lines
570 B
C
33 lines
570 B
C
|
|
/* test of plausible behaviour with malloc and stupid args */
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
int main ( void )
|
|
{
|
|
char* p;
|
|
|
|
p = malloc(0);
|
|
printf("malloc(0) = 0x%lx\n", (unsigned long)p);
|
|
free(p);
|
|
|
|
p = malloc(-1);
|
|
printf("malloc(-1) = 0x%lx\n", (unsigned long)p);
|
|
free(p);
|
|
|
|
p = calloc(0,1);
|
|
printf("calloc(0,1) = 0x%lx\n", (unsigned long)p);
|
|
free(p);
|
|
|
|
p = calloc(0,-1);
|
|
printf("calloc(0,-1) = 0x%lx\n", (unsigned long)p);
|
|
free(p);
|
|
|
|
p = calloc(-1,-1);
|
|
printf("calloc(-1,-1) = 0x%lx\n", (unsigned long)p);
|
|
free(p);
|
|
|
|
return 0;
|
|
}
|