add uninitialized allocator tests

This commit is contained in:
Daniel Micay 2018-08-24 05:02:00 -04:00
parent 2d168b0516
commit fe85116891
4 changed files with 27 additions and 0 deletions

View File

@ -12,3 +12,6 @@ all: \
invalid_free_protected \
invalid_free_unprotected \
invalid_free_small_region \
uninitialized_free \
uninitialized_realloc \
uninitialized_malloc_usable_size \

View File

@ -0,0 +1,7 @@
#include <stdlib.h>
__attribute__((optimize(0)))
int main(void) {
free((void *)1);
return 0;
}

View File

@ -0,0 +1,7 @@
#include <malloc.h>
__attribute__((optimize(0)))
int main(void) {
malloc_usable_size((void *)1);
return 0;
}

View File

@ -0,0 +1,10 @@
#include <stdlib.h>
__attribute__((optimize(0)))
int main(void) {
void *p = realloc((void *)1, 16);
if (!p) {
return 1;
}
return 0;
}