5 #include "../../memcheck.h"
10 VALGRIND_DO_LEAK_CHECK
;
11 pi
= reallocarray(pi
, 10U, sizeof(int));
12 VALGRIND_DO_ADDED_LEAK_CHECK
;
13 pi
= reallocarray(pi
, 0U, sizeof(int));
14 VALGRIND_DO_ADDED_LEAK_CHECK
;
15 pi
= reallocarray(pi
, 10U, 0U);
17 VALGRIND_DO_CHANGED_LEAK_CHECK
;
19 pi
= reallocarray(pi
, 10U, sizeof(int));
20 VALGRIND_DO_ADDED_LEAK_CHECK
;
22 pi
= reallocarray(pi
, 1UL << 49, 1U);
24 assert(errno
== ENOMEM
);
25 VALGRIND_DO_CHANGED_LEAK_CHECK
;
26 pi
= reallocarray(pi
, SIZE_MAX
/1000U, SIZE_MAX
/1000U);
28 assert(errno
== ENOMEM
);
29 VALGRIND_DO_CHANGED_LEAK_CHECK
;