jit.dg: fix issue with compilation of test-threads.c
commit6b5236a82def484f192baf4091233caf0d607985
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Jan 2017 20:47:12 +0000 (18 20:47 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Jan 2017 20:47:12 +0000 (18 20:47 +0000)
tree117c77e302da4a098308991869e1843bde1be954
parente617f12e3324517e1dc744fba1f9fe081794ab29
jit.dg: fix issue with compilation of test-threads.c

DejaGnu's <dejagnu.h> provides decls of various inline functions,
of which the jit testsuite uses "pass", "fail" and "note".

The jit testcase test-threads.c jumps through some hoops to make
these functions threadsafe, using macros to rename the implementation
in dejagnu.h, giving them a "dejagnu_" prefix, then reimplementing
the names with wrappers that use a mutex.

The DejaGnu functions gained a "static" modifier in
ad36659ffa984a0541cfc2bd27f393e0d7d173a7, which appears to be in
DejaGnu 1.5.2 onwards.

Unfortunately, jit.dg/test-threads.c has forward decls of
"dejagnu_pass" etc, and these don't have "static", leading to conflicts
with later versions of DejaGnu for which "pass" etc have "static".

This patch fixes things by removing the forward decls of
"dejagnu_pass", moving the usage of them to a point at which dejagnu.h
has been included, which ought to work with both earlier and later
versions of DejaGnu.

Fixes compilation of test-threads.c in jit testsuite.

gcc/testsuite/ChangeLog:
* jit.dg/test-threads.c (dejagnu_pass): Remove decl.
(dejagnu_fail): Likewise.
(dejagnu_note): Likewise.
(pass): Provide forward decl, moving true decl to after #include
of harness.h.
(fail): Likewise.
(note): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244597 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/testsuite/ChangeLog
gcc/testsuite/jit.dg/test-threads.c