]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
PPC64, fix test_isa_3_0_other.c test
authorCarl Love <carll@us.ibm.com>
Fri, 5 Apr 2019 20:04:23 +0000 (15:04 -0500)
committerCarl Love <carll@us.ibm.com>
Fri, 5 Apr 2019 20:04:23 +0000 (15:04 -0500)
Valgrind ppc64 test_isa_3_0_other test will attempt to display
all of the bits of the XER as part of the test case results.
The tests have no existing logic to clear those bits, so this can
pick up straggling values that cascade into a testcase failure.
This adds some code to correct this in two directions;
    - Print only the bits that are expected by the tests.  This
    is currently just the OV and OV32 bits.
    - print all of the bits when run under higher verbosity levels.

Bugzilla 406198 - none/tests/ppc64/test_isa_3_0_other test sporadically
                  including CA bit in output

Patch submitted by  Will Schmidt <will_schmidt@vnet.ibm.com>
Patch reviewed, committed by: Carl Love <cel@us.ibm.com>

NEWS
none/tests/ppc64/ppc64_helpers.h

diff --git a/NEWS b/NEWS
index 8e5ea704acf25d5b37818164ebd8398f87e41632..9a1e9dd480e7eaf109e3177c6ded0f85ba48c6e7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -137,6 +137,8 @@ where XXXXXX is the bug number as listed below.
 405734  PPC64, vrlwnm, vrlwmi, vrldrm, vrldmi do not work properly when me < mb
 405782  "VEX temporary storage exhausted" when attempting to debug slic3r-pe
 405722  Support arm64 core dump
+406198  none/tests/ppc64/test_isa_3_0_other test sporadically including CA
+        bit in output.
 
 n-i-bz  add syswrap for PTRACE_GET|SET_THREAD_AREA on amd64.
 n-i-bz  Fix callgrind_annotate non deterministic order for equal total
index 5b8f31413ae8dd7cd7516bbd7bf234c918d5c4f4..36c473710b6ffaf0bab3a083c4d70f4e9f1efe16 100644 (file)
@@ -405,12 +405,28 @@ static void dissect_xer_raw(unsigned long local_xer) {
          printf(" %s", xer_strings[i]);
    }
 }
+/* Display only the XER contents that are relevant for our tests.
+ * this is currently the OV and OV32 bits.  */
+static void dissect_xer_valgrind(unsigned long local_xer) {
+   int i;
+   long mybit;
+      i = 33;  // OV
+      mybit = 1ULL << (63 - i);
+      if (mybit & local_xer) printf(" %s", xer_strings[i]);
+      i = 44;  // OV32
+      mybit = 1ULL << (63 - i);
+      if (mybit & local_xer) printf(" %s", xer_strings[i]);
+}
+
 
 /* */
 static void dissect_xer(unsigned long local_xer) {
    if (verbose > 1)
       printf(" [[ xer:%lx ]]", local_xer);
-   dissect_xer_raw(local_xer);
+   if (verbose > 2 )
+      dissect_xer_raw(local_xer);
+   else
+      dissect_xer_valgrind(local_xer);
 }