On 11/19/14 03:46, David Malcolm wrote:
This commit updates jit.exp so that if RUN_UNDER_VALGRIND is present
in the environment, all of the built client code using libgccjit.so is
run under valgrind, with --leak-check=full.
Hence:
RUN_UNDER_VALGRIND= make check-jit
will run all jit testcases under valgrind (taking 27 mins on my
machine).
Results are written to testsuite/jit/test-FOO.exe.valgrind.txt
jit.exp automatically parses these result file, looking for lines of
the form
definitely lost: 11,316 bytes in 235 blocks
indirectly lost: 352 bytes in 4 blocks
in the valgrind log's summary footer, adding PASSes if they are zero
bytes, and, for now generating XFAILs for non-zero bytes.
Sadly this diverges jit.exp's fixed_host_execute further from DejaGnu's
host_execute, but I don't see a clean way to fix that.
This currently adds 63 PASSes and 49 XFAILs to jit.sum, giving:
# of expected passes 2481
# of expected failures 49
gcc/testsuite/ChangeLog:
PR jit/63854
* jit.dg/jit.exp (report_leak): New.
(parse_valgrind_logfile): New.
(fixed_host_execute): Detect if RUN_UNDER_VALGRIND is present
in the environment, and if so, run the executable under
valgrind, capturing valgrind's output to a logfile. Parse the
log file, generating PASSes and XFAILs for the summary of leaks.
OK for the trunk. FWIW, I'd love to see a mode where we can easily do
this for the other testsuites as well.
All this work is definitely appreciated -- Jakub usually does similar
stuff later in the release process, so you're offloading some stuff from
him, which definitely helps.
jeff