|
From: Paul F. <pa...@so...> - 2023-03-05 15:44:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e99cd3c6a36d0cb250850da8a79cdf5ef85d8401 commit e99cd3c6a36d0cb250850da8a79cdf5ef85d8401 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:43:25 2023 +0100 Linux musl: corrections for aligned_alloc test Diff: --- memcheck/tests/linux/Makefile.am | 1 + memcheck/tests/linux/aligned_alloc.c | 6 +++--- memcheck/tests/linux/aligned_alloc.vgtest | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index 895f76ed69..af88e8cb6f 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -38,6 +38,7 @@ EXTRA_DIST = \ memalign.vgtest memalign.stderr.exp check_PROGRAMS = \ + aligned_alloc \ brk \ capget \ check_preadv2_pwritev2 \ diff --git a/memcheck/tests/linux/aligned_alloc.c b/memcheck/tests/linux/aligned_alloc.c index 15955ff845..0cffe085b3 100644 --- a/memcheck/tests/linux/aligned_alloc.c +++ b/memcheck/tests/linux/aligned_alloc.c @@ -11,8 +11,8 @@ int main(void) // zero size p = aligned_alloc(0, 8); - assert(p == NULL && errno == EINVAL); - errno = 0; + assert(p && ((size_t)p % 8U == 0U)); + free(p); // non multiple of alignment passes on FreeBSD p = aligned_alloc(8, 25); assert(p && ((size_t)p % 8U == 0U)); @@ -20,7 +20,7 @@ int main(void) //errno = 0; // align not power of 2 p = aligned_alloc(40, 160); - assert(p == NULL && errno == EINVAL); + assert(p == NULL); errno = 0; // the test below causes a segfault with musl 1.2.2 // apparently it has been fixed in 1.2.3 diff --git a/memcheck/tests/linux/aligned_alloc.vgtest b/memcheck/tests/linux/aligned_alloc.vgtest index 07c1c4faf7..a20bccb007 100644 --- a/memcheck/tests/linux/aligned_alloc.vgtest +++ b/memcheck/tests/linux/aligned_alloc.vgtest @@ -1 +1,2 @@ prog: aligned_alloc +vgopts: -q |