Makefile changes, run target only reruns dynamic tests
[libc-test] / src / regression / malloc-0.c
1 // commit: 26031da0f83a2a3ed52190077931ee6c18dfd689 2011-02-20
2 // malloc(0) should return unique pointers
3 #include <stdlib.h>
4 #include "test.h"
5
6 int main(void)
7 {
8         void *p = malloc(0);
9         void *q = malloc(0);
10         void *r = malloc(0);
11         if (!p || !q || !r)
12                 t_error("malloc(0) returned NULL\n");
13         if (p == q || p == r || q == r)
14                 t_error("malloc(0) returned non-unique pointers: %p, %p, %p\n", p, q, r);
15         free(q);
16         free(p);
17         free(r);
18         return t_status;
19 }