From: Andreas Arnez Date: Thu, 19 Oct 2023 12:17:35 +0000 (+0200) Subject: s390x regtest: Fix memcheck tests for cu21 and cu42 with Clang X-Git-Tag: VALGRIND_3_22_0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29d8cc5c6a718d1af89d0ad3241e445994b16add;p=thirdparty%2Fvalgrind.git s390x regtest: Fix memcheck tests for cu21 and cu42 with Clang When compiled with Clang, the s390x memcheck tests for cu21 and cu42 yield different line number information for the inline assemblies. Using gcc, the inline assemblies do not receive updated line number information because they are phrased as if they were data, not code. See also the discussion in https://sourceware.org/bugzilla/show_bug.cgi?id=30206 Fix this by rephrasing the inline assemblies in cu21 and cu42 to normal instructions, using the respective mnemonics. Since this affects the line number information, adjust the expected test output files as well. --- diff --git a/memcheck/tests/s390x/cu21.c b/memcheck/tests/s390x/cu21.c index dd9654bdf3..d86ffde3d0 100644 --- a/memcheck/tests/s390x/cu21.c +++ b/memcheck/tests/s390x/cu21.c @@ -45,7 +45,7 @@ do_cu21(uint8_t *dst, uint64_t dst_len, uint16_t *src, uint64_t src_len) register uint64_t dest_len asm("3") = dst_len; asm volatile( - CU21(0,2,4) + "cu21 2,4,0" : "+d"(dest), "+d"(source), "+d"(source_len), "+d"(dest_len) : : "memory", "cc"); diff --git a/memcheck/tests/s390x/cu21.stderr.exp b/memcheck/tests/s390x/cu21.stderr.exp index 25563f2bd6..ca31ed2b72 100644 --- a/memcheck/tests/s390x/cu21.stderr.exp +++ b/memcheck/tests/s390x/cu21.stderr.exp @@ -1,65 +1,65 @@ Invalid write of size 2 - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:62) Address 0x........ is 0 bytes inside a block of size 1 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu21.c:62) Invalid write of size 2 - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:68) Address 0x........ is 0 bytes inside a block of size 1 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu21.c:68) Invalid write of size 1 - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:68) Address 0x........ is 1 bytes after a block of size 1 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu21.c:68) Invalid write of size 1 - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:71) Address 0x........ is 0 bytes after a block of size 2 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu21.c:71) Invalid write of size 4 - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:77) Address 0x........ is 0 bytes inside a block of size 1 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu21.c:77) Invalid write of size 4 - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:80) Address 0x........ is 0 bytes inside a block of size 2 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu21.c:80) Invalid write of size 4 - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:83) Address 0x........ is 0 bytes inside a block of size 3 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu21.c:83) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:94) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:99) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:104) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu21 (cu21.c:45) + at 0x........: do_cu21 (cu21.c:47) by 0x........: main (cu21.c:116) diff --git a/memcheck/tests/s390x/cu42.c b/memcheck/tests/s390x/cu42.c index 185b0dd84a..557e1926d9 100644 --- a/memcheck/tests/s390x/cu42.c +++ b/memcheck/tests/s390x/cu42.c @@ -31,7 +31,7 @@ do_cu42(uint16_t *dst, uint64_t dst_len, uint32_t *src, uint64_t src_len) register uint64_t dest_len asm("3") = dst_len; asm volatile( - CU42(2,4) + "cu42 2,4" : "+d"(dest), "+d"(source), "+d"(source_len), "+d"(dest_len) : : "memory", "cc"); diff --git a/memcheck/tests/s390x/cu42.stderr.exp b/memcheck/tests/s390x/cu42.stderr.exp index 246b22a403..93e584d8c1 100644 --- a/memcheck/tests/s390x/cu42.stderr.exp +++ b/memcheck/tests/s390x/cu42.stderr.exp @@ -1,52 +1,52 @@ Invalid write of size 2 - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:47) Address 0x........ is 0 bytes inside a block of size 1 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu42.c:47) Invalid write of size 4 - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:53) Address 0x........ is 0 bytes inside a block of size 1 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu42.c:53) Invalid write of size 4 - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:56) Address 0x........ is 0 bytes inside a block of size 2 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu42.c:56) Invalid write of size 4 - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:59) Address 0x........ is 0 bytes inside a block of size 3 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: main (cu42.c:59) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:72) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:77) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:82) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:87) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:92) Conditional jump or move depends on uninitialised value(s) - at 0x........: do_cu42 (cu42.c:31) + at 0x........: do_cu42 (cu42.c:33) by 0x........: main (cu42.c:104)