Add test for stupid malloc etc args.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@129 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d122548..0f144e7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,4 +23,7 @@
signal3.c smc1.c \
suppfree.c tronical.c \
tronical.s twoparams.c \
- twoparams.s
\ No newline at end of file
+ twoparams.s \
+ pth_cvsimple.c pth_simple_threads.c pth_simple_mutex.c \
+ bt_everything.c bt_literal.c \
+ pth_threadpool.c pth_specific.c pth_mutexspeed.c malloc3.c
diff --git a/tests/malloc3.c b/tests/malloc3.c
new file mode 100644
index 0000000..896645c
--- /dev/null
+++ b/tests/malloc3.c
@@ -0,0 +1,32 @@
+
+/* 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) = %p\n", p);
+ free(p);
+
+ p = malloc(-1);
+ printf("malloc(-1) = %p\n", p);
+ free(p);
+
+ p = calloc(0,1);
+ printf("calloc(0,1) = %p\n", p);
+ free(p);
+
+ p = calloc(0,-1);
+ printf("calloc(0,-1) = %p\n", p);
+ free(p);
+
+ p = calloc(-1,-1);
+ printf("calloc(-1,-1) = %p\n", p);
+ free(p);
+
+ return 0;
+}