Add a dummy usage of a pointer in tests
This way clang with O1 doesn't optimize it. Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
2b3c06edb3
commit
cf669b058b
1 changed files with 2 additions and 0 deletions
|
@ -126,6 +126,8 @@ void check_mbedtls_calloc_overallocation(intmax_t num, intmax_t size)
|
|||
{
|
||||
unsigned char *buf;
|
||||
buf = mbedtls_calloc((size_t) num, (size_t) size);
|
||||
/* Dummy usage of the pointer to prevent optimizing it */
|
||||
mbedtls_printf("calloc pointer : %p\n", buf);
|
||||
TEST_ASSERT(buf == NULL);
|
||||
|
||||
exit:
|
||||
|
|
Loading…
Reference in a new issue