]> git.ipfire.org Git - thirdparty/gcc.git/commit
JIT, testsuite, Darwin: Initial testsuite fixes.
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 5 Aug 2021 09:07:03 +0000 (10:07 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 9 Jun 2022 19:23:05 +0000 (20:23 +0100)
commitd75b8abc7b033990ea27aec020b5b95454d0ec83
treef006a264b2d2a5eac29c1ea4060700bb6ff56e91
parente1f99a4b0563e53a6ea5d03b44d5a4c27699c50b
JIT, testsuite, Darwin: Initial testsuite fixes.

The testsuite setup for jit is not compatible with Darwin since it
assumes that all targets support --export-dynamic.

 - this is fixed by adding '-rdynamic' conditionally upon target
   support for that (-rdynamic will be converted to the appropriate
   linker option).

There is also an assumption that a suitable version of dejagnu.h
is present in some default include search path that is usable from
the testsuite.  This is not the case for Darwin (dejagnu.h is not
installed, and would not, in general, be found in any default include
search path if installed via one of the main 'distros').  Also the
upstream dejagnu.h has a definition of 'wait()' that clashes with a
libc routines and therefore causes fails in the testsuite.

 - This patch imports the header from dejagnu-1.6.2 and
   * renames it to 'jit-dejagnu.h'
   * patches it to avoid unused variable warnings and the clash
     with the libc definition of wait ()
   * In accordance with the advice in the expect man page, ensures
     that the final output of the 'totals' print is stable.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/jit/ChangeLog:

* docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
* docs/examples/tut04-toyvm/toyvm.cc: Likewise.
* jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
patched for this application.

gcc/testsuite/ChangeLog:

* jit.dg/harness.h: Include jit-dejagnu.h.
* jit.dg/jit.exp: Use -rdynamic conditionally on target
support, instead of unconditional -Wl,--export-dynamic.

(cherry picked from commit eea1677fd03a1cb820cbb72044d4a0770f8a7a93)
gcc/jit/docs/examples/tut04-toyvm/toyvm.c
gcc/jit/docs/examples/tut04-toyvm/toyvm.cc
gcc/jit/jit-dejagnu.h [new file with mode: 0644]
gcc/testsuite/jit.dg/harness.h
gcc/testsuite/jit.dg/jit.exp