From: Paul Floyd Date: Sun, 5 Mar 2023 15:43:25 +0000 (+0100) Subject: Linux musl: corrections for aligned_alloc test X-Git-Tag: VALGRIND_3_21_0~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e99cd3c6a36d0cb250850da8a79cdf5ef85d8401;p=thirdparty%2Fvalgrind.git Linux musl: corrections for aligned_alloc test --- 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