PPC64, fix test_isa_3_0_other.c test

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>
This commit is contained in:
Carl Love 2019-04-05 15:04:23 -05:00
parent d36ea889d8
commit 7804ba3deb
2 changed files with 19 additions and 1 deletions

2
NEWS
View File

@ -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

View 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);
}