On Tue, 2018-10-16 at 14:26 -0600, Jeff Law wrote:
> On 10/13/18 7:12 AM, David Malcolm wrote:
> > On Fri, 2018-10-12 at 14:17 -0400, David Malcolm wrote:
> > > On Fri, 2018-10-12 at 14:45 -0400, David Malcolm wrote:
> > > > [re this thread "ToT build failure?":
> > > >   https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00344.html ]
> > > > 
> > > > On Thu, 2017-07-06 at 20:58 +0200, Jakub Jelinek wrote:
> > > > > On Thu, Jul 06, 2017 at 01:45:42PM -0400, David Malcolm
> > > > > wrote:
> > > > > > Given that the previous status quo of the selftests was to
> > > > > > require
> > > > > > the
> > > > > > C frontend, I committed the attached patch (as r250036),
> > > > > > under
> > > > > > the
> > > > > > "obvious" rule, retaining the ability to optionally run the
> > > > > > selftests
> > > > > > within the C++ frontend.
> > > > > 
> > > > > You should do something similar for how we make check etc.:
> > > > > CHECK_TARGETS = @check_languages@
> > > > > 
> > > > > check: $(CHECK_TARGETS)
> > > > > 
> > > > > and then each Make-lang.in defining its check-<lang> goal.
> > > > > So similarly to that s-selftest-c++ should be in cp/Make-
> > > > > lang.in
> > > > > and based on the configured languages should include the s-
> > > > > selftest-
> > > > > <lang>
> > > > > dependencies.
> > > > > 
> > > > >       Jakub
> > > > 
> > > > Thanks.
> > > > 
> > > > I attemped the above, but it required each Make-lang.in to
> > > > define
> > > > a check-<lang> goal, but there are only two that make sense to
> > > > run
> > > > (those that set LANG_HOOKS_RUN_LANG_SELFTESTS: C and C++).
> > > > 
> > > > Rather than add one to every Make-lang.in, I borrowing the
> > > > "append"
> > > > approach used by "lang_checks", so that only the Make-lang.in
> > > > files
> > > > that opt-in to having selftests need to do anything, appending
> > > > their s-selftest-<LANG> to lang_selftests.
> > > > 
> > > > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> > > > I manually verified that the self-tests were run 6 times: C and
> > > > C++,
> > > > for each of the three stages (each run taking well under a
> > > > second).
> > > > 
> > > > OK for trunk?
> > > 
> > > Sorry; I failed to properly check the case Steve ran into back in
> > > July,
> > > and my patch doesn't handle it (all of the Make-lang.in files are
> > > included, regardless of configuration, via LANG_MAKEFRAGS).
> > > 
> > > I'm working on an updated patch.
> > > 
> > > Dave
> > 
> > Here's an updated version; sorry for the earlier noise.
> > 
> > This one follows the approach you suggested, adding a
> > SELFTEST_TARGETS
> > built from a configure-supplied selftest_languages.  Each Make-
> > lang.in
> > defines a selftest-LANG, which becomes a dependency of "selftest".
> > Almost all of the selftest-LANG are empty, apart from those for c
> > and c++.
> > 
> > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> > As before, I manually verified that the self-tests were run 6
> > times: c and
> > c++, for each of the three stages (each run taking well under a
> > second).
> > This time I also verified that it builds successfully without c++
> > (via:
> > "--enable-languages=c --disable-bootstrap"), for which it just ran
> > the
> > c selftests.
> > 
> > OK for trunk?
> > 
> > gcc/ChangeLog:
> >     * Makefile.in (SELFTEST_TARGETS): New.
> >     (selftest) Change from s-selftest-c to $(SELFTEST_TARGETS).
> >     (C_SELFTEST_FLAGS, C_SELFTEST_DEPS, s-selftest-c, selftest-c-
> > gdb)
> >     (selftest-gdb, selftest-c-valgrind, selftest-valgrind): Move to
> >     c/Make-lang.in.
> >     (CPP_SELFTEST_FLAGS, CPP_SELFTEST_DEPS, s-selftest-c++)
> >     (selftest-c++-gdb, selftest-c++-valgrind): Move to
> >     cp/Make-lang.in.
> >     * configure: Regenerate.
> >     * configure.ac (selftest_languages): New.
> > 
> > gcc/brig/ChangeLog:
> >     * Make-lang.in (selftest-brig): New.
> > 
> > gcc/c/ChangeLog:
> >     * Make-lang.in (selftest-c): New.
> >     (C_SELFTEST_FLAGS, C_SELFTEST_DEPS, s-selftest-c, selftest-c-
> > gdb)
> >     (selftest-gdb, selftest-c-valgrind, selftest-valgrind): Move
> > here
> >     from gcc/Makefile.in.
> > 
> > gcc/cp/ChangeLog:
> >     * Make-lang.in (selftest-c++): New.
> >     (CPP_SELFTEST_FLAGS, CPP_SELFTEST_DEPS, s-selftest-c++)
> >     (selftest-c++-gdb, selftest-c++-valgrind): Move here from
> >     gcc/Makefile.in.
> > 
> > gcc/fortran/ChangeLog:
> >     * Make-lang.in (selftest-fortran): New.
> > 
> > gcc/go/ChangeLog:
> >     * Make-lang.in (selftest-go): New.
> > 
> > gcc/jit/ChangeLog:
> >     * Make-lang.in (selftest-jit): New.
> > 
> > gcc/lto/ChangeLog:
> >     * Make-lang.in (selftest-lto): New.
> > 
> > gcc/objc/ChangeLog:
> >     * Make-lang.in (selftest-objc): New.
> > 
> > gcc/objcp/ChangeLog:
> >     * Make-lang.in (selftest-obj-c++): New.
> > ---
> 
> OK.
> jeff

Thanks; I've committed this to trunk as r265240.

Iain: a heads-up re D: I think you'll need to add an empty 
  selftest-d: 
makefile target to the D frontend's Make-lang.in next time you refresh
your patches against trunk (see the various examples from that commit
above).

Dave

Reply via email to