testsuite: add coverage for diagnostics relating to inlining (PR tree-optimization...
commit6d8c9f39007790df9c08fca1e4c458a22b04e9c4
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Dec 2017 19:23:30 +0000 (18 19:23 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Dec 2017 19:23:30 +0000 (18 19:23 +0000)
tree7302a65ee17fdb19155db0c24ffe950010dc58f8
parentc30a685849f8ea200d9bdacf305cf81f4e8d1300
testsuite: add coverage for diagnostics relating to inlining (PR tree-optimization/83336)

In theory, the diagnostics subsystem can print context information on
code inlining when diagnostics are emitted by the middle-end, describing
the chain of inlined callsites that led to a particular warning,
but PR tree-optimization/83336 describes various issues with this.

An underlying issue is that we have very little automated testing for
this code: gcc.dg/tm/pr52141.c has a test, but in general, prune.exp
filters out the various "inlined from" lines.

The following patch adds test coverage for it for C and C++ via a new
testsuite plugin, which emits a warning from the middle-end; the test
cases use dg-regexp to verify that the "inlined from" lines are
emitted correctly, with the correct function names and source locations.

Doing so requires a change to prune.exp: the dg-regexp lines have to
be handled *before* the "inlined from" lines are stripped.

gcc/testsuite/ChangeLog:
PR tree-optimization/83336
* g++.dg/cpp0x/missing-initializer_list-include.C: Update for
changes to prune.exp's handling of dg-regexp.
* g++.dg/plugin/diagnostic-test-inlining-1.C: New test case.
* g++.dg/plugin/plugin.exp (plugin_test_list): Add it, via
gcc.dg's plugin/diagnostic_plugin_test_inlining.c.
* gcc.dg/plugin/diagnostic-test-inlining-1.c: New test case.
* gcc.dg/plugin/diagnostic-test-inlining-2.c: Likewise.
* gcc.dg/plugin/diagnostic-test-inlining-3.c: Likewise.
* gcc.dg/plugin/diagnostic-test-inlining-4.c: Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_inlining.c: New test
plugin.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add them.
* lib/prune.exp (prune_gcc_output): Move call to handle-dg-regexps
to before the various text stripping regsup invocations,
in particular, to before the stripping of "inlined from".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255786 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/missing-initializer_list-include.C
gcc/testsuite/g++.dg/plugin/diagnostic-test-inlining-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/plugin/plugin.exp
gcc/testsuite/gcc.dg/plugin/diagnostic-test-inlining-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/diagnostic-test-inlining-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/diagnostic-test-inlining-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/diagnostic-test-inlining-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_inlining.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/plugin.exp
gcc/testsuite/lib/prune.exp