This is the mail archive of the
mailing list for the GCC project.
Re: tests for GCC internal functions
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, Martin Sebor <msebor at gmail dot com>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Wed, 16 Aug 2017 11:20:23 -0400
- Subject: Re: tests for GCC internal functions
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dmalcolm at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E33313D3F82
- References: <firstname.lastname@example.org> <20170816145104.GC17069@redhat.com>
On Wed, 2017-08-16 at 16:51 +0200, Marek Polacek wrote:
> On Wed, Aug 16, 2017 at 08:46:20AM -0600, Martin Sebor wrote:
> > Is there a setup for writing and running as part of the test
> > suite unit tests that exercise internal GCC functions like
> > error and warning? I ask because of a couple of bugs that
> > were recently reported for the %s directive in GCC's
> > diagnostics (81859 and 81586) that were only caught by running
> > valgrind on GCC, but that could have been caught by GCC's own
> > tests for these APIs if they existed.
> > I can't find any except some in the gcc.dg/plugin directory
> > (though they weren't written to exercise the functions but
> > rather the plugin interface). Would adding a plugin for
> > this sort of thing be the right way to do it?
> Isn't -fself-test the thing you're looking for?
Indeed; looking at those bugs, it looks like you want to be adding
to/extending the selftests near end of pretty-print.c (that way you can
easily re-run them under valgrind via "make selftest-valgrind");
probably in selftest::test_pp_format, which already has a little
coverage for %s.