]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x regtest: Fix memcheck tests for cu21 and cu42 with Clang
authorAndreas Arnez <arnez@linux.ibm.com>
Thu, 19 Oct 2023 12:17:35 +0000 (14:17 +0200)
committerAndreas Arnez <arnez@linux.ibm.com>
Thu, 19 Oct 2023 12:27:16 +0000 (14:27 +0200)
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.

memcheck/tests/s390x/cu21.c
memcheck/tests/s390x/cu21.stderr.exp
memcheck/tests/s390x/cu42.c
memcheck/tests/s390x/cu42.stderr.exp

index dd9654bdf344b1a17ca811af3c539bf3dec9911c..d86ffde3d002586753e9a0cfcc0b7c1ed8790b61 100644 (file)
@@ -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");
index 25563f2bd66b707b5fdb1de956c89c9212f2f808..ca31ed2b72970cfe31bc392fa0dcd0a196f6c313 100644 (file)
@@ -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)
 
index 185b0dd84a2232b6ed63755b8b5bfa65d508bc51..557e1926d91bd11b50bdf56345164f19098b750e 100644 (file)
@@ -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");
index 246b22a403308c13079171f69d3af6af7a0b2b2f..93e584d8c1e56447b4ca8d854dd6bbe1bf321279 100644 (file)
@@ -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)