Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / solaris / aligned_alloc.c
blob346595f29e52b2579f2699537f21ac808df64594
1 #include <stdlib.h>
2 #include <assert.h>
3 #include <errno.h>
4 #include "../../config.h"
6 int main(void)
8 #if defined(HAVE_ALIGNED_ALLOC)
9 char* p = NULL;
11 // zero size
12 p = aligned_alloc(0, 8);
13 assert(p == NULL && errno == EINVAL);
14 errno = 0;
15 // non multiple of alignment passes on Solaris
16 p = aligned_alloc(8, 25);
17 assert(p && ((size_t)p % 8U == 0U));
18 free(p);
19 //errno = 0;
20 // align not power of 2
21 p = aligned_alloc(40, 160);
22 assert(p);
23 errno = 0;
25 // too big aligment
26 if (sizeof(size_t) == 8)
28 p = aligned_alloc(16, 1UL<<48);
30 else
32 p = NULL;
33 errno = ENOMEM;
36 assert(p == NULL && errno == ENOMEM);
37 #endif