PR other/69006: fix extra newlines after diagnostics
gcc/c-family/ChangeLog: PR other/69006 * c-opts.c (c_diagnostic_finalizer): Replace invocation of pp_newline_and_flush with pp_flush. gcc/cp/ChangeLog: PR other/69006 * error.c (print_instantiation_partial_context_line): Add missing newlines from output for the t == NULL case. (print_instantiation_partial_context): Remove call to pp_newline. gcc/ChangeLog: PR other/69006 * diagnostic-show-locus.c (layout::print_source_line): Replace call to pp_newline with call to layout::print_newline. (layout::print_annotation_line): Likewise. (layout::move_to_column): Likewise. (layout::print_any_fixits): After printing any fixits, print a trailing newline, if necessary. (layout::print_newline): New method, resetting any colorization before a newline. (diagnostic_show_locus): Move the pp_newline to before the early bailout. Remove dummy block enclosing the layout instance. * diagnostic.c (default_diagnostic_finalizer): Replace invocation of pp_newline_and_flush with pp_flush. (diagnostic_append_note): Delete use of pp_newline. (diagnostic_append_note_at_rich_loc): Delete. * diagnostic.h (diagnostic_append_note_at_rich_loc): Delete. * pretty-print.h (output_buffer_append_r): Reset buff->line_length when newline characters are added to the buffer. gcc/fortran/ChangeLog: PR other/69006 * error.c (gfc_diagnostic_starter): Delete use of pp_newline. gcc/testsuite/ChangeLog: PR other/69006 * g++.dg/ext/timevar1.C: Add dg-allow-blank-lines-in-output directive. * gcc.dg/plugin/diagnostic-test-show-locus-color.c: Update expected multiline output to reflect the colorization being disabled before newlines. * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (custom_diagnostic_finalizer): Replace call to pp_newline_and_flush with call to pp_flush. * gcc.dg/unroll-2.c: Add dg-allow-blank-lines-in-output directive. * gfortran.dg/implicit_class_1.f90: Likewise. * lib/gcc-dg.exp (allow_blank_lines): New global. (dg-allow-blank-lines-in-output): New procedure. (gcc-dg-prune): Complain about blank lines in the output, unless dg-allow-blank-lines-in-output was called. * lib/multiline.exp (_build_multiline_regex): Only support arbitrary followup text for non-blank-lines, not for blank lines. From-SVN: r232837
This commit is contained in:
parent
3dde4d658b
commit
01e1dea37c
|
@ -1,3 +1,24 @@
|
||||||
|
2016-01-26 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
|
PR other/69006
|
||||||
|
* diagnostic-show-locus.c (layout::print_source_line): Replace
|
||||||
|
call to pp_newline with call to layout::print_newline.
|
||||||
|
(layout::print_annotation_line): Likewise.
|
||||||
|
(layout::move_to_column): Likewise.
|
||||||
|
(layout::print_any_fixits): After printing any fixits, print a
|
||||||
|
trailing newline, if necessary.
|
||||||
|
(layout::print_newline): New method, resetting any colorization
|
||||||
|
before a newline.
|
||||||
|
(diagnostic_show_locus): Move the pp_newline to before the
|
||||||
|
early bailout. Remove dummy block enclosing the layout instance.
|
||||||
|
* diagnostic.c (default_diagnostic_finalizer): Replace invocation
|
||||||
|
of pp_newline_and_flush with pp_flush.
|
||||||
|
(diagnostic_append_note): Delete use of pp_newline.
|
||||||
|
(diagnostic_append_note_at_rich_loc): Delete.
|
||||||
|
* diagnostic.h (diagnostic_append_note_at_rich_loc): Delete.
|
||||||
|
* pretty-print.h (output_buffer_append_r): Reset buff->line_length
|
||||||
|
when newline characters are added to the buffer.
|
||||||
|
|
||||||
2016-01-26 Michael Matz <matz@suse.de>
|
2016-01-26 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
* configure.ac (ac_cv_std_swap_in_utility): New test.
|
* configure.ac (ac_cv_std_swap_in_utility): New test.
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-01-26 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
|
PR other/69006
|
||||||
|
* c-opts.c (c_diagnostic_finalizer): Replace invocation of
|
||||||
|
pp_newline_and_flush with pp_flush.
|
||||||
|
|
||||||
2016-01-20 Martin Sebor <msebor@redhat.com>
|
2016-01-20 Martin Sebor <msebor@redhat.com>
|
||||||
|
|
||||||
PR c/69405
|
PR c/69405
|
||||||
|
|
|
@ -169,7 +169,7 @@ c_diagnostic_finalizer (diagnostic_context *context,
|
||||||
finalizer -- for tokens resulting from macro expansion. */
|
finalizer -- for tokens resulting from macro expansion. */
|
||||||
virt_loc_aware_diagnostic_finalizer (context, diagnostic);
|
virt_loc_aware_diagnostic_finalizer (context, diagnostic);
|
||||||
pp_destroy_prefix (context->printer);
|
pp_destroy_prefix (context->printer);
|
||||||
pp_newline_and_flush (context->printer);
|
pp_flush (context->printer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common default settings for diagnostics. */
|
/* Common default settings for diagnostics. */
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2016-01-26 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
|
PR other/69006
|
||||||
|
* error.c (print_instantiation_partial_context_line): Add missing
|
||||||
|
newlines from output for the t == NULL case.
|
||||||
|
(print_instantiation_partial_context): Remove call to pp_newline.
|
||||||
|
|
||||||
2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
|
2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
|
||||||
|
|
||||||
Revert:
|
Revert:
|
||||||
|
|
|
@ -3365,8 +3365,8 @@ print_instantiation_partial_context_line (diagnostic_context *context,
|
||||||
{
|
{
|
||||||
pp_verbatim (context->printer,
|
pp_verbatim (context->printer,
|
||||||
recursive_p
|
recursive_p
|
||||||
? _("recursively required from here")
|
? _("recursively required from here\n")
|
||||||
: _("required from here"));
|
: _("required from here\n"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3450,7 +3450,6 @@ print_instantiation_partial_context (diagnostic_context *context,
|
||||||
}
|
}
|
||||||
print_instantiation_partial_context_line (context, NULL, loc,
|
print_instantiation_partial_context_line (context, NULL, loc,
|
||||||
/*recursive_p=*/false);
|
/*recursive_p=*/false);
|
||||||
pp_newline (context->printer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called from cp_thing to print the template context for an error. */
|
/* Called from cp_thing to print the template context for an error. */
|
||||||
|
|
|
@ -159,6 +159,8 @@ class layout
|
||||||
void print_any_fixits (int row, const rich_location *richloc);
|
void print_any_fixits (int row, const rich_location *richloc);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void print_newline ();
|
||||||
|
|
||||||
bool
|
bool
|
||||||
get_state_at_point (/* Inputs. */
|
get_state_at_point (/* Inputs. */
|
||||||
int row, int column,
|
int row, int column,
|
||||||
|
@ -574,7 +576,7 @@ layout::print_source_line (int row, line_bounds *lbounds_out)
|
||||||
pp_character (m_pp, c);
|
pp_character (m_pp, c);
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
pp_newline (m_pp);
|
print_newline ();
|
||||||
|
|
||||||
lbounds_out->m_first_non_ws = first_non_ws;
|
lbounds_out->m_first_non_ws = first_non_ws;
|
||||||
lbounds_out->m_last_non_ws = last_non_ws;
|
lbounds_out->m_last_non_ws = last_non_ws;
|
||||||
|
@ -616,7 +618,7 @@ layout::print_annotation_line (int row, const line_bounds lbounds)
|
||||||
pp_character (m_pp, ' ');
|
pp_character (m_pp, ' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pp_newline (m_pp);
|
print_newline ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there are any fixit hints on source line ROW within RICHLOC, print them.
|
/* If there are any fixit hints on source line ROW within RICHLOC, print them.
|
||||||
|
@ -684,6 +686,18 @@ layout::print_any_fixits (int row, const rich_location *richloc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add a trailing newline, if necessary. */
|
||||||
|
move_to_column (&column, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Disable any colorization and emit a newline. */
|
||||||
|
|
||||||
|
void
|
||||||
|
layout::print_newline ()
|
||||||
|
{
|
||||||
|
m_colorizer.set_normal_text ();
|
||||||
|
pp_newline (m_pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true if (ROW/COLUMN) is within a range of the layout.
|
/* Return true if (ROW/COLUMN) is within a range of the layout.
|
||||||
|
@ -778,7 +792,7 @@ layout::move_to_column (int *column, int dest_column)
|
||||||
/* Start a new line if we need to. */
|
/* Start a new line if we need to. */
|
||||||
if (*column > dest_column)
|
if (*column > dest_column)
|
||||||
{
|
{
|
||||||
pp_newline (m_pp);
|
print_newline ();
|
||||||
*column = 0;
|
*column = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,6 +812,8 @@ void
|
||||||
diagnostic_show_locus (diagnostic_context * context,
|
diagnostic_show_locus (diagnostic_context * context,
|
||||||
const diagnostic_info *diagnostic)
|
const diagnostic_info *diagnostic)
|
||||||
{
|
{
|
||||||
|
pp_newline (context->printer);
|
||||||
|
|
||||||
if (!context->show_caret
|
if (!context->show_caret
|
||||||
|| diagnostic_location (diagnostic, 0) <= BUILTINS_LOCATION
|
|| diagnostic_location (diagnostic, 0) <= BUILTINS_LOCATION
|
||||||
|| diagnostic_location (diagnostic, 0) == context->last_location)
|
|| diagnostic_location (diagnostic, 0) == context->last_location)
|
||||||
|
@ -805,34 +821,23 @@ diagnostic_show_locus (diagnostic_context * context,
|
||||||
|
|
||||||
context->last_location = diagnostic_location (diagnostic, 0);
|
context->last_location = diagnostic_location (diagnostic, 0);
|
||||||
|
|
||||||
pp_newline (context->printer);
|
|
||||||
|
|
||||||
const char *saved_prefix = pp_get_prefix (context->printer);
|
const char *saved_prefix = pp_get_prefix (context->printer);
|
||||||
pp_set_prefix (context->printer, NULL);
|
pp_set_prefix (context->printer, NULL);
|
||||||
|
|
||||||
{
|
layout layout (context, diagnostic);
|
||||||
layout layout (context, diagnostic);
|
int last_line = layout.get_last_line ();
|
||||||
int last_line = layout.get_last_line ();
|
for (int row = layout.get_first_line (); row <= last_line; row++)
|
||||||
for (int row = layout.get_first_line ();
|
{
|
||||||
row <= last_line;
|
/* Print the source line, followed by an annotation line
|
||||||
row++)
|
consisting of any caret/underlines, then any fixits.
|
||||||
{
|
If the source line can't be read, print nothing. */
|
||||||
/* Print the source line, followed by an annotation line
|
line_bounds lbounds;
|
||||||
consisting of any caret/underlines, then any fixits.
|
if (layout.print_source_line (row, &lbounds))
|
||||||
If the source line can't be read, print nothing. */
|
{
|
||||||
line_bounds lbounds;
|
layout.print_annotation_line (row, lbounds);
|
||||||
if (layout.print_source_line (row, &lbounds))
|
layout.print_any_fixits (row, diagnostic->richloc);
|
||||||
{
|
}
|
||||||
layout.print_annotation_line (row, lbounds);
|
}
|
||||||
layout.print_any_fixits (row, diagnostic->richloc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The closing scope here leads to the dtor for layout and thus
|
|
||||||
colorizer being called here, which affects the precise
|
|
||||||
place where colorization is turned off in the unittest
|
|
||||||
for colorized output. */
|
|
||||||
}
|
|
||||||
|
|
||||||
pp_set_prefix (context->printer, saved_prefix);
|
pp_set_prefix (context->printer, saved_prefix);
|
||||||
}
|
}
|
||||||
|
|
|
@ -546,7 +546,7 @@ default_diagnostic_finalizer (diagnostic_context *context,
|
||||||
{
|
{
|
||||||
diagnostic_show_locus (context, diagnostic);
|
diagnostic_show_locus (context, diagnostic);
|
||||||
pp_destroy_prefix (context->printer);
|
pp_destroy_prefix (context->printer);
|
||||||
pp_newline_and_flush (context->printer);
|
pp_flush (context->printer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interface to specify diagnostic kind overrides. Returns the
|
/* Interface to specify diagnostic kind overrides. Returns the
|
||||||
|
@ -879,37 +879,6 @@ diagnostic_append_note (diagnostic_context *context,
|
||||||
saved_prefix = pp_get_prefix (context->printer);
|
saved_prefix = pp_get_prefix (context->printer);
|
||||||
pp_set_prefix (context->printer,
|
pp_set_prefix (context->printer,
|
||||||
diagnostic_build_prefix (context, &diagnostic));
|
diagnostic_build_prefix (context, &diagnostic));
|
||||||
pp_newline (context->printer);
|
|
||||||
pp_format (context->printer, &diagnostic.message);
|
|
||||||
pp_output_formatted_text (context->printer);
|
|
||||||
pp_destroy_prefix (context->printer);
|
|
||||||
pp_set_prefix (context->printer, saved_prefix);
|
|
||||||
diagnostic_show_locus (context, &diagnostic);
|
|
||||||
va_end (ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Same as diagnostic_append_note, but at RICHLOC. */
|
|
||||||
|
|
||||||
void
|
|
||||||
diagnostic_append_note_at_rich_loc (diagnostic_context *context,
|
|
||||||
rich_location *richloc,
|
|
||||||
const char * gmsgid, ...)
|
|
||||||
{
|
|
||||||
diagnostic_info diagnostic;
|
|
||||||
va_list ap;
|
|
||||||
const char *saved_prefix;
|
|
||||||
|
|
||||||
va_start (ap, gmsgid);
|
|
||||||
diagnostic_set_info (&diagnostic, gmsgid, &ap, richloc, DK_NOTE);
|
|
||||||
if (context->inhibit_notes_p)
|
|
||||||
{
|
|
||||||
va_end (ap);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
saved_prefix = pp_get_prefix (context->printer);
|
|
||||||
pp_set_prefix (context->printer,
|
|
||||||
diagnostic_build_prefix (context, &diagnostic));
|
|
||||||
pp_newline (context->printer);
|
|
||||||
pp_format (context->printer, &diagnostic.message);
|
pp_format (context->printer, &diagnostic.message);
|
||||||
pp_output_formatted_text (context->printer);
|
pp_output_formatted_text (context->printer);
|
||||||
pp_destroy_prefix (context->printer);
|
pp_destroy_prefix (context->printer);
|
||||||
|
|
|
@ -293,10 +293,6 @@ extern void diagnostic_set_info_translated (diagnostic_info *, const char *,
|
||||||
ATTRIBUTE_GCC_DIAG(2,0);
|
ATTRIBUTE_GCC_DIAG(2,0);
|
||||||
extern void diagnostic_append_note (diagnostic_context *, location_t,
|
extern void diagnostic_append_note (diagnostic_context *, location_t,
|
||||||
const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
|
const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
|
||||||
extern void diagnostic_append_note_at_rich_loc (diagnostic_context *,
|
|
||||||
rich_location *,
|
|
||||||
const char *, ...)
|
|
||||||
ATTRIBUTE_GCC_DIAG(3,4);
|
|
||||||
#endif
|
#endif
|
||||||
extern char *diagnostic_build_prefix (diagnostic_context *, const diagnostic_info *);
|
extern char *diagnostic_build_prefix (diagnostic_context *, const diagnostic_info *);
|
||||||
void default_diagnostic_starter (diagnostic_context *, diagnostic_info *);
|
void default_diagnostic_starter (diagnostic_context *, diagnostic_info *);
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-01-26 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
|
PR other/69006
|
||||||
|
* error.c (gfc_diagnostic_starter): Delete use of pp_newline.
|
||||||
|
|
||||||
2016-01-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2016-01-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/69397
|
PR fortran/69397
|
||||||
|
|
|
@ -1096,7 +1096,6 @@ gfc_diagnostic_starter (diagnostic_context *context,
|
||||||
/* Fortran uses an empty line between locus and caret line. */
|
/* Fortran uses an empty line between locus and caret line. */
|
||||||
pp_newline (context->printer);
|
pp_newline (context->printer);
|
||||||
diagnostic_show_locus (context, diagnostic);
|
diagnostic_show_locus (context, diagnostic);
|
||||||
pp_newline (context->printer);
|
|
||||||
/* If the caret line was shown, the prefix does not contain the
|
/* If the caret line was shown, the prefix does not contain the
|
||||||
locus. */
|
locus. */
|
||||||
pp_set_prefix (context->printer, kind_prefix);
|
pp_set_prefix (context->printer, kind_prefix);
|
||||||
|
|
|
@ -125,7 +125,11 @@ output_buffer_append_r (output_buffer *buff, const char *start, int length)
|
||||||
{
|
{
|
||||||
gcc_checking_assert (start);
|
gcc_checking_assert (start);
|
||||||
obstack_grow (buff->obstack, start, length);
|
obstack_grow (buff->obstack, start, length);
|
||||||
buff->line_length += length;
|
for (int i = 0; i < length; i++)
|
||||||
|
if (start[i] == '\n')
|
||||||
|
buff->line_length = 0;
|
||||||
|
else
|
||||||
|
buff->line_length++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a pointer to the last character emitted in the
|
/* Return a pointer to the last character emitted in the
|
||||||
|
|
|
@ -1,3 +1,23 @@
|
||||||
|
2016-01-26 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
|
PR other/69006
|
||||||
|
* g++.dg/ext/timevar1.C: Add dg-allow-blank-lines-in-output
|
||||||
|
directive.
|
||||||
|
* gcc.dg/plugin/diagnostic-test-show-locus-color.c: Update
|
||||||
|
expected multiline output to reflect the colorization being
|
||||||
|
disabled before newlines.
|
||||||
|
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
|
||||||
|
(custom_diagnostic_finalizer): Replace call to
|
||||||
|
pp_newline_and_flush with call to pp_flush.
|
||||||
|
* gcc.dg/unroll-2.c: Add dg-allow-blank-lines-in-output directive.
|
||||||
|
* gfortran.dg/implicit_class_1.f90: Likewise.
|
||||||
|
* lib/gcc-dg.exp (allow_blank_lines): New global.
|
||||||
|
(dg-allow-blank-lines-in-output): New procedure.
|
||||||
|
(gcc-dg-prune): Complain about blank lines in the output, unless
|
||||||
|
dg-allow-blank-lines-in-output was called.
|
||||||
|
* lib/multiline.exp (_build_multiline_regex): Only support
|
||||||
|
arbitrary followup text for non-blank-lines, not for blank lines.
|
||||||
|
|
||||||
2016-01-26 Jakub Jelinek <jakub@redhat.com>
|
2016-01-26 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR tree-optimization/69483
|
PR tree-optimization/69483
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// PR c++/52248
|
// PR c++/52248
|
||||||
// { dg-options "-ftime-report" }
|
// { dg-options "-ftime-report" }
|
||||||
|
// { dg-allow-blank-lines-in-output 1 }
|
||||||
// { dg-prune-output "wall" }
|
// { dg-prune-output "wall" }
|
||||||
// { dg-prune-output "times" }
|
// { dg-prune-output "times" }
|
||||||
// { dg-prune-output "TOTAL" }
|
// { dg-prune-output "TOTAL" }
|
||||||
|
|
|
@ -15,8 +15,7 @@ void test_simple (void)
|
||||||
|
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
myvar = [32m[Kmyvar[m[K[01;35m[K.[m[K[34m[Kx[m[K;
|
myvar = [32m[Kmyvar[m[K[01;35m[K.[m[K[34m[Kx[m[K;
|
||||||
[32m[K~~~~~[m[K[01;35m[K^[m[K[34m[K~
|
[32m[K~~~~~[m[K[01;35m[K^[m[K[34m[K~[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -28,8 +27,7 @@ void test_simple_2 (void)
|
||||||
|
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
x = [32m[Kfirst_function ()[m[K [01;35m[K+[m[K [34m[Ksecond_function ()[m[K;
|
x = [32m[Kfirst_function ()[m[K [01;35m[K+[m[K [34m[Ksecond_function ()[m[K;
|
||||||
[32m[K~~~~~~~~~~~~~~~~~[m[K [01;35m[K^[m[K [34m[K~~~~~~~~~~~~~~~~~~
|
[32m[K~~~~~~~~~~~~~~~~~[m[K [01;35m[K^[m[K [34m[K~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -42,11 +40,10 @@ void test_multiline (void)
|
||||||
+ second_function ()); /* { dg-warning "test" } */
|
+ second_function ()); /* { dg-warning "test" } */
|
||||||
|
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
x = ([32m[Kfirst_function ()
|
x = ([32m[Kfirst_function ()[m[K
|
||||||
[m[K [32m[K~~~~~~~~~~~~~~~~~
|
[32m[K~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [01;35m[K+[m[K [34m[Ksecond_function ()[m[K);
|
[01;35m[K+[m[K [34m[Ksecond_function ()[m[K);
|
||||||
[01;35m[K^[m[K [34m[K~~~~~~~~~~~~~~~~~~
|
[01;35m[K^[m[K [34m[K~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -67,29 +64,28 @@ void test_many_lines (void)
|
||||||
magna, aliqua));
|
magna, aliqua));
|
||||||
|
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
x = ([32m[Kfirst_function_with_a_very_long_name (lorem, ipsum, dolor, sit, amet,
|
x = ([32m[Kfirst_function_with_a_very_long_name (lorem, ipsum, dolor, sit, amet,[m[K
|
||||||
[m[K [32m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
[32m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [32m[K consectetur, adipiscing, elit,
|
[32m[K consectetur, adipiscing, elit,[m[K
|
||||||
[m[K [32m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
[32m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [32m[K sed, eiusmod, tempor,
|
[32m[K sed, eiusmod, tempor,[m[K
|
||||||
[m[K [32m[K~~~~~~~~~~~~~~~~~~~~~
|
[32m[K~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [32m[K incididunt, ut, labore, et,
|
[32m[K incididunt, ut, labore, et,[m[K
|
||||||
[m[K [32m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
[32m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [32m[K dolore, magna, aliqua)
|
[32m[K dolore, magna, aliqua)[m[K
|
||||||
[m[K [32m[K~~~~~~~~~~~~~~~~~~~~~~
|
[32m[K~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [01;35m[K+[m[K [34m[Ksecond_function_with_a_very_long_name (lorem, ipsum, dolor, sit,
|
[01;35m[K+[m[K [34m[Ksecond_function_with_a_very_long_name (lorem, ipsum, dolor, sit,
|
||||||
[m[K [01;35m[K^[m[K [34m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
[01;35m[K^[m[K [34m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [34m[K amet, consectetur,
|
[34m[K amet, consectetur,[m[K
|
||||||
[m[K [34m[K~~~~~~~~~~~~~~~~~~
|
[34m[K~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [34m[K adipiscing, elit, sed,
|
[34m[K adipiscing, elit, sed,[m[K
|
||||||
[m[K [34m[K~~~~~~~~~~~~~~~~~~~~~~
|
[34m[K~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [34m[K eiusmod, tempor, incididunt,
|
[34m[K eiusmod, tempor, incididunt,[m[K
|
||||||
[m[K [34m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
[34m[K~~~~~~~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [34m[K ut, labore, et, dolore,
|
[34m[K ut, labore, et, dolore,[m[K
|
||||||
[m[K [34m[K~~~~~~~~~~~~~~~~~~~~~~~
|
[34m[K~~~~~~~~~~~~~~~~~~~~~~~[m[K
|
||||||
[m[K [34m[K magna, aliqua)[m[K);
|
[34m[K magna, aliqua)[m[K);
|
||||||
[34m[K~~~~~~~~~~~~~~
|
[34m[K~~~~~~~~~~~~~~[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -100,8 +96,7 @@ void test_richloc_from_proper_range (void)
|
||||||
float f = 98.6f; /* { dg-warning "test" } */
|
float f = 98.6f; /* { dg-warning "test" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
float f = [01;35m[K98.6f[m[K;
|
float f = [01;35m[K98.6f[m[K;
|
||||||
[01;35m[K^~~~~
|
[01;35m[K^~~~~[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -112,8 +107,7 @@ void test_caret_within_proper_range (void)
|
||||||
float f = foo * bar; /* { dg-warning "17: test" } */
|
float f = foo * bar; /* { dg-warning "17: test" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
float f = [01;35m[Kfoo * bar[m[K;
|
float f = [01;35m[Kfoo * bar[m[K;
|
||||||
[01;35m[K~~~~^~~~~
|
[01;35m[K~~~~^~~~~[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -124,8 +118,7 @@ void test_very_wide_line (void)
|
||||||
float f = foo * bar; /* { dg-warning "95: test" } */
|
float f = foo * bar; /* { dg-warning "95: test" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
float f = [01;35m[Kfoo * bar[m[K;
|
float f = [01;35m[Kfoo * bar[m[K;
|
||||||
[01;35m[K~~~~^~~~~
|
[01;35m[K~~~~^~~~~[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -136,8 +129,7 @@ void test_multiple_carets (void)
|
||||||
x = x + y /* { dg-warning "8: test" } */
|
x = x + y /* { dg-warning "8: test" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
x = [01;35m[Kx[m[K + [32m[Ky[m[K
|
x = [01;35m[Kx[m[K + [32m[Ky[m[K
|
||||||
[01;35m[KA[m[K [32m[KB
|
[01;35m[KA[m[K [32m[KB[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -149,10 +141,9 @@ void test_caret_on_leading_whitespace (void)
|
||||||
y = 5 /* { dg-warning "6: test" } */
|
y = 5 /* { dg-warning "6: test" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
ASSOCIATE (y =>[32m[K [m[Kx)
|
ASSOCIATE (y =>[32m[K [m[Kx)
|
||||||
[32m[K2
|
[32m[K2[m[K
|
||||||
[m[K [01;35m[K [m[Ky = 5
|
[01;35m[K [m[Ky = 5
|
||||||
[01;35m[K1
|
[01;35m[K1[m[K
|
||||||
[m[K
|
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -166,8 +157,8 @@ void test_fixit_insert (void)
|
||||||
int a[2][2] = { 0, 1 , 2, 3 }; /* { dg-warning "insertion hints" } */
|
int a[2][2] = { 0, 1 , 2, 3 }; /* { dg-warning "insertion hints" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
int a[2][2] = { [01;35m[K0, 1[m[K , 2, 3 };
|
int a[2][2] = { [01;35m[K0, 1[m[K , 2, 3 };
|
||||||
[01;35m[K^~~~
|
[01;35m[K^~~~[m[K
|
||||||
{[m[K [01;35m[K}[m[K
|
[01;35m[K{[m[K [01;35m[K}[m[K
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -180,8 +171,8 @@ void test_fixit_remove (void)
|
||||||
int a;; /* { dg-warning "example of a removal hint" } */
|
int a;; /* { dg-warning "example of a removal hint" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
int a;[01;35m[K;[m[K
|
int a;[01;35m[K;[m[K
|
||||||
[01;35m[K^
|
[01;35m[K^[m[K
|
||||||
-[m[K
|
[01;35m[K-[m[K
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -194,8 +185,8 @@ void test_fixit_replace (void)
|
||||||
gtk_widget_showall (dlg); /* { dg-warning "example of a replacement hint" } */
|
gtk_widget_showall (dlg); /* { dg-warning "example of a replacement hint" } */
|
||||||
/* { dg-begin-multiline-output "" }
|
/* { dg-begin-multiline-output "" }
|
||||||
[01;35m[Kgtk_widget_showall[m[K (dlg);
|
[01;35m[Kgtk_widget_showall[m[K (dlg);
|
||||||
[01;35m[K^~~~~~~~~~~~~~~~~~
|
[01;35m[K^~~~~~~~~~~~~~~~~~[m[K
|
||||||
gtk_widget_show_all[m[K
|
[01;35m[Kgtk_widget_show_all[m[K
|
||||||
{ dg-end-multiline-output "" } */
|
{ dg-end-multiline-output "" } */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ custom_diagnostic_finalizer (diagnostic_context *context,
|
||||||
pp_show_color (context->printer) = old_show_color;
|
pp_show_color (context->printer) = old_show_color;
|
||||||
|
|
||||||
pp_destroy_prefix (context->printer);
|
pp_destroy_prefix (context->printer);
|
||||||
pp_newline_and_flush (context->printer);
|
pp_flush (context->printer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exercise the diagnostic machinery to emit various warnings,
|
/* Exercise the diagnostic machinery to emit various warnings,
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
/* { dg-do compile } */
|
/* { dg-do compile } */
|
||||||
/* { dg-options "-O2 -fdump-tree-cunrolli-details=stderr -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll -fenable-tree-cunrolli" } */
|
/* { dg-options "-O2 -fdump-tree-cunrolli-details=stderr -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll -fenable-tree-cunrolli" } */
|
||||||
|
|
||||||
|
/* Blank lines can occur in the output of
|
||||||
|
-fdump-tree-cunrolli-details=stderr. */
|
||||||
|
/* { dg-allow-blank-lines-in-output 1 } */
|
||||||
|
|
||||||
unsigned a[100], b[100];
|
unsigned a[100], b[100];
|
||||||
inline void bar()
|
inline void bar()
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
! segfault is working correctly. No cleanup needed, because the dump
|
! segfault is working correctly. No cleanup needed, because the dump
|
||||||
! goes to stdout.
|
! goes to stdout.
|
||||||
! { dg-options "-fdump-fortran-original" }
|
! { dg-options "-fdump-fortran-original" }
|
||||||
|
! { dg-allow-blank-lines-in-output 1 }
|
||||||
! { dg-prune-output "Namespace:.*-{42}" }
|
! { dg-prune-output "Namespace:.*-{42}" }
|
||||||
|
|
||||||
program upimp
|
program upimp
|
||||||
|
|
|
@ -310,6 +310,19 @@ proc gcc-dg-test { prog do_what extra_tool_flags } {
|
||||||
return [gcc-dg-test-1 gcc_target_compile $prog $do_what $extra_tool_flags]
|
return [gcc-dg-test-1 gcc_target_compile $prog $do_what $extra_tool_flags]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Global: should blank lines be allowed in the output?
|
||||||
|
# By default, they should not be. (PR other/69006)
|
||||||
|
# However, there are some ways for them to validly occur.
|
||||||
|
set allow_blank_lines 0
|
||||||
|
|
||||||
|
# A command for use by testcases to mark themselves as expecting
|
||||||
|
# blank lines in the output.
|
||||||
|
|
||||||
|
proc dg-allow-blank-lines-in-output { args } {
|
||||||
|
global allow_blank_lines
|
||||||
|
set allow_blank_lines 1
|
||||||
|
}
|
||||||
|
|
||||||
proc gcc-dg-prune { system text } {
|
proc gcc-dg-prune { system text } {
|
||||||
global additional_prunes
|
global additional_prunes
|
||||||
|
|
||||||
|
@ -317,6 +330,17 @@ proc gcc-dg-prune { system text } {
|
||||||
# Always remember to clear it in .exp file after executed all tests.
|
# Always remember to clear it in .exp file after executed all tests.
|
||||||
global dg_runtest_extra_prunes
|
global dg_runtest_extra_prunes
|
||||||
|
|
||||||
|
# Complain about blank lines in the output (PR other/69006)
|
||||||
|
global allow_blank_lines
|
||||||
|
if { !$allow_blank_lines } {
|
||||||
|
set num_blank_lines [llength [regexp -all -inline "\n\n" $text]]
|
||||||
|
if { $num_blank_lines } {
|
||||||
|
global testname_with_flags
|
||||||
|
fail "$testname_with_flags $num_blank_lines blank line(s) in output"
|
||||||
|
}
|
||||||
|
set allow_blank_lines 0
|
||||||
|
}
|
||||||
|
|
||||||
set text [prune_gcc_output $text]
|
set text [prune_gcc_output $text]
|
||||||
|
|
||||||
foreach p "$additional_prunes $dg_runtest_extra_prunes" {
|
foreach p "$additional_prunes $dg_runtest_extra_prunes" {
|
||||||
|
|
|
@ -224,10 +224,12 @@ proc _build_multiline_regex { multiline index } {
|
||||||
set rexp "${rexp}\\|"
|
set rexp "${rexp}\\|"
|
||||||
} else {
|
} else {
|
||||||
# Assume that we have a quoted source line.
|
# Assume that we have a quoted source line.
|
||||||
# Support arbitrary followup text on each line,
|
if {![string equal "" $line] } {
|
||||||
# to deal with comments containing containing DejaGnu
|
# Support arbitrary followup text on each non-empty line,
|
||||||
# directives.
|
# to deal with comments containing containing DejaGnu
|
||||||
append rexp ".*"
|
# directives.
|
||||||
|
append rexp ".*"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
append rexp "\n"
|
append rexp "\n"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue