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". From-SVN: r255786
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
attribute_plugin-test-1.C | Loading commit data... | |
attribute_plugin.c | Loading commit data... | |
comment_plugin.c | Loading commit data... | |
comments-1.C | Loading commit data... | |
decl-plugin-test.C | Loading commit data... | |
decl_plugin.c | Loading commit data... | |
def-plugin-test.C | Loading commit data... | |
def_plugin.c | Loading commit data... | |
diagnostic-test-expressions-1.C | Loading commit data... | |
diagnostic-test-inlining-1.C | Loading commit data... | |
dumb-plugin-test-1.C | Loading commit data... | |
dumb_plugin.c | Loading commit data... | |
header-plugin-test.C | Loading commit data... | |
header_plugin.c | Loading commit data... | |
plugin.exp | Loading commit data... | |
pragma_plugin-test-1.C | Loading commit data... | |
pragma_plugin.c | Loading commit data... | |
self-assign-test-1.C | Loading commit data... | |
self-assign-test-2.C | Loading commit data... | |
self-assign-test-3.C | Loading commit data... | |
selfassign.c | Loading commit data... | |
show-template-tree-color-no-elide-type.C | Loading commit data... | |
show-template-tree-color.C | Loading commit data... | |
show_template_tree_color_plugin.c | Loading commit data... |