From 101e910b3a59d878b21afadf0d23330d45d57b73 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 13 Nov 2017 15:32:34 +0000 Subject: [PATCH] [Diagnostic Patch] don't print column zero https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01911.html * diagnostic.c (maybe_line_and_column): New. (diagnostic_get_location_text): Use it. (diagnostic_report_current_module): Likewise. (test_diagnostic_get_location_text): Add tests. * lib/gcc-dg.exp (process-message): Use -: for no column. * c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Mark elided column messages. * c-c++-common/cpp/pr58844-1.c: Likewise. * c-c++-common/cpp/pr58844-2.c: Likewise. * c-c++-common/cpp/warning-zero-location.c: Likewise. * g++.dg/diagnostic/pr77949.C: Likewise. * g++.dg/gomp/macro-4.C: Likewise. * gcc.dg/Wunknownprag.c: Likewise. * gcc.dg/builtin-redefine.c: Likewise. * gcc.dg/cpp/Wunknown-pragmas-1.c: Likewise. * gcc.dg/cpp/Wunused.c: Likewise. * gcc.dg/cpp/misspelled-directive-1.c: Likewise. * gcc.dg/cpp/redef2.c: Likewise. * gcc.dg/cpp/redef3.c: Likewise. * gcc.dg/cpp/redef4.c: Likewise. * gcc.dg/cpp/trad/Wunused.c: Likewise. * gcc.dg/cpp/trad/argcount.c: Likewise. * gcc.dg/cpp/trad/comment-3.c: Likewise. * gcc.dg/cpp/trad/comment.c: Likewise. * gcc.dg/cpp/trad/defined.c: Likewise. * gcc.dg/cpp/trad/directive.c: Likewise. * gcc.dg/cpp/trad/funlike-3.c: Likewise. * gcc.dg/cpp/trad/funlike.c: Likewise. * gcc.dg/cpp/trad/literals-2.c: Likewise. * gcc.dg/cpp/trad/macro.c: Likewise. * gcc.dg/cpp/trad/pr65238-4.c: Likewise. * gcc.dg/cpp/trad/recurse-1.c: Likewise. * gcc.dg/cpp/trad/recurse-2.c: Likewise. * gcc.dg/cpp/trad/redef2.c: Likewise. * gcc.dg/cpp/ucnid-11.c: Likewise. * gcc.dg/cpp/unc1.c: Likewise. * gcc.dg/cpp/unc2.c: Likewise. * gcc.dg/cpp/unc3.c: Likewise. * gcc.dg/cpp/unc4.c: Likewise. * gcc.dg/cpp/undef2.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * gcc.dg/cpp/warn-redefined.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-unused-macros.c: Likewise. * gcc.dg/empty-source-2.c: Likewise. * gcc.dg/empty-source-3.c: Likewise. * gcc.dg/gomp/macro-4.c: Likewise. * gcc.dg/noncompile/pr35447-1.c: Likewise. * gcc.dg/plugin/location-overflow-test-1.c: Likewise. * gcc.dg/pr20245-1.c: Likewise. * gcc.dg/pr28419.c: Likewise. * gcc.dg/rtl/truncated-rtl-file.c: Likewise. * gcc.dg/unclosed-init.c: Likewise. From-SVN: r254691 --- gcc/ChangeLog | 7 + gcc/diagnostic.c | 65 ++- gcc/testsuite/ChangeLog | 54 +- .../cilk-plus/CK/cilk_for_grain_errors.c | 2 +- gcc/testsuite/c-c++-common/cpp/pr58844-1.c | 4 +- gcc/testsuite/c-c++-common/cpp/pr58844-2.c | 4 +- .../c-c++-common/cpp/warning-zero-location.c | 2 +- gcc/testsuite/g++.dg/diagnostic/pr77949.C | 2 +- gcc/testsuite/g++.dg/gomp/macro-4.C | 8 +- gcc/testsuite/gcc.dg/Wunknownprag.c | 8 +- gcc/testsuite/gcc.dg/builtin-redefine.c | 18 +- gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c | 18 +- gcc/testsuite/gcc.dg/cpp/Wunused.c | 6 +- .../gcc.dg/cpp/misspelled-directive-1.c | 2 +- gcc/testsuite/gcc.dg/cpp/redef2.c | 20 +- gcc/testsuite/gcc.dg/cpp/redef3.c | 14 +- gcc/testsuite/gcc.dg/cpp/redef4.c | 520 +++++++++--------- gcc/testsuite/gcc.dg/cpp/trad/Wunused.c | 6 +- gcc/testsuite/gcc.dg/cpp/trad/argcount.c | 24 +- gcc/testsuite/gcc.dg/cpp/trad/comment-3.c | 2 +- gcc/testsuite/gcc.dg/cpp/trad/comment.c | 2 +- gcc/testsuite/gcc.dg/cpp/trad/defined.c | 2 +- gcc/testsuite/gcc.dg/cpp/trad/directive.c | 2 +- gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c | 4 +- gcc/testsuite/gcc.dg/cpp/trad/funlike.c | 2 +- gcc/testsuite/gcc.dg/cpp/trad/literals-2.c | 4 +- gcc/testsuite/gcc.dg/cpp/trad/macro.c | 2 +- gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c | 12 +- gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c | 4 +- gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c | 6 +- gcc/testsuite/gcc.dg/cpp/trad/redef2.c | 36 +- gcc/testsuite/gcc.dg/cpp/ucnid-11.c | 12 +- gcc/testsuite/gcc.dg/cpp/unc1.c | 2 +- gcc/testsuite/gcc.dg/cpp/unc2.c | 2 +- gcc/testsuite/gcc.dg/cpp/unc3.c | 2 +- gcc/testsuite/gcc.dg/cpp/unc4.c | 2 +- gcc/testsuite/gcc.dg/cpp/undef2.c | 10 +- gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c | 10 +- gcc/testsuite/gcc.dg/cpp/warn-redefined.c | 10 +- .../gcc.dg/cpp/warn-unused-macros-2.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c | 2 +- gcc/testsuite/gcc.dg/empty-source-2.c | 2 +- gcc/testsuite/gcc.dg/empty-source-3.c | 2 +- gcc/testsuite/gcc.dg/gomp/macro-4.c | 8 +- gcc/testsuite/gcc.dg/noncompile/pr35447-1.c | 2 +- .../gcc.dg/plugin/location-overflow-test-1.c | 4 +- gcc/testsuite/gcc.dg/pr20245-1.c | 2 +- gcc/testsuite/gcc.dg/pr28419.c | 1 + gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c | 2 +- gcc/testsuite/gcc.dg/unclosed-init.c | 2 +- gcc/testsuite/lib/gcc-dg.exp | 17 +- 51 files changed, 520 insertions(+), 438 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c31208aa7bc..316bd020c07 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-11-13 Nathan Sidwell + + * diagnostic.c (maybe_line_and_column): New. + (diagnostic_get_location_text): Use it. + (diagnostic_report_current_module): Likewise. + (test_diagnostic_get_location_text): Add tests. + 2017-11-13 Luis Machado * doc/md.texi (Specifying processor pipeline description): Fix diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 813bca6f65d..86201333d00 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -291,6 +291,25 @@ diagnostic_get_color_for_kind (diagnostic_t kind) return diagnostic_kind_color[kind]; } +/* Return a formatted line and column ':%line:%column'. Elided if + zero. The result is a statically allocated buffer. */ + +static const char * +maybe_line_and_column (int line, int col) +{ + static char result[32]; + + if (line) + { + size_t l = snprintf (result, sizeof (result), + col ? ":%d:%d" : ":%d", line, col); + gcc_checking_assert (l < sizeof (result)); + } + else + result[0] = 0; + return result; +} + /* Return a malloc'd string describing a location e.g. "foo.c:42:10". The caller is responsible for freeing the memory. */ @@ -301,19 +320,13 @@ diagnostic_get_location_text (diagnostic_context *context, pretty_printer *pp = context->printer; const char *locus_cs = colorize_start (pp_show_color (pp), "locus"); const char *locus_ce = colorize_stop (pp_show_color (pp)); + const char *file = s.file ? s.file : progname; + int line = strcmp (file, N_("")) ? s.line : 0; + int col = context->show_column ? s.column : 0; - if (s.file == NULL) - return build_message_string ("%s%s:%s", locus_cs, progname, locus_ce); - - if (!strcmp (s.file, N_(""))) - return build_message_string ("%s%s:%s", locus_cs, s.file, locus_ce); - - if (context->show_column) - return build_message_string ("%s%s:%d:%d:%s", locus_cs, s.file, s.line, - s.column, locus_ce); - else - return build_message_string ("%s%s:%d:%s", locus_cs, s.file, s.line, - locus_ce); + const char *line_col = maybe_line_and_column (line, col); + return build_message_string ("%s%s%s:%s", locus_cs, file, + line_col, locus_ce); } /* Return a malloc'd string describing a location and the severity of the @@ -575,21 +588,20 @@ diagnostic_report_current_module (diagnostic_context *context, location_t where) if (! MAIN_FILE_P (map)) { map = INCLUDED_FROM (line_table, map); - if (context->show_column) - pp_verbatim (context->printer, - "In file included from %r%s:%d:%d%R", "locus", - LINEMAP_FILE (map), - LAST_SOURCE_LINE (map), LAST_SOURCE_COLUMN (map)); - else - pp_verbatim (context->printer, - "In file included from %r%s:%d%R", "locus", - LINEMAP_FILE (map), LAST_SOURCE_LINE (map)); + const char *line_col + = maybe_line_and_column (LAST_SOURCE_LINE (map), + context->show_column + ? LAST_SOURCE_COLUMN (map) : 0); + pp_verbatim (context->printer, + "In file included from %r%s%s%R", "locus", + LINEMAP_FILE (map), line_col); while (! MAIN_FILE_P (map)) { map = INCLUDED_FROM (line_table, map); + line_col = maybe_line_and_column (LAST_SOURCE_LINE (map), 0); pp_verbatim (context->printer, - ",\n from %r%s:%d%R", "locus", - LINEMAP_FILE (map), LAST_SOURCE_LINE (map)); + ",\n from %r%s%s%R", "locus", + LINEMAP_FILE (map), line_col); } pp_verbatim (context->printer, ":"); pp_newline (context->printer); @@ -1663,7 +1675,14 @@ test_diagnostic_get_location_text () assert_location_text ("PROGNAME:", NULL, 0, 0, true); assert_location_text (":", "", 42, 10, true); assert_location_text ("foo.c:42:10:", "foo.c", 42, 10, true); + assert_location_text ("foo.c:42:", "foo.c", 42, 0, true); + assert_location_text ("foo.c:", "foo.c", 0, 10, true); assert_location_text ("foo.c:42:", "foo.c", 42, 10, false); + assert_location_text ("foo.c:", "foo.c", 0, 10, false); + + maybe_line_and_column (INT_MAX, INT_MAX); + maybe_line_and_column (INT_MIN, INT_MIN); + progname = old_progname; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7d6348534d..e887d3e55c4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,58 @@ +2017-11-13 Nathan Sidwell + + * lib/gcc-dg.exp (process-message): Use -: for no column. + * c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Mark elided + column messages. + * c-c++-common/cpp/pr58844-1.c: Likewise. + * c-c++-common/cpp/pr58844-2.c: Likewise. + * c-c++-common/cpp/warning-zero-location.c: Likewise. + * g++.dg/diagnostic/pr77949.C: Likewise. + * g++.dg/gomp/macro-4.C: Likewise. + * gcc.dg/Wunknownprag.c: Likewise. + * gcc.dg/builtin-redefine.c: Likewise. + * gcc.dg/cpp/Wunknown-pragmas-1.c: Likewise. + * gcc.dg/cpp/Wunused.c: Likewise. + * gcc.dg/cpp/misspelled-directive-1.c: Likewise. + * gcc.dg/cpp/redef2.c: Likewise. + * gcc.dg/cpp/redef3.c: Likewise. + * gcc.dg/cpp/redef4.c: Likewise. + * gcc.dg/cpp/trad/Wunused.c: Likewise. + * gcc.dg/cpp/trad/argcount.c: Likewise. + * gcc.dg/cpp/trad/comment-3.c: Likewise. + * gcc.dg/cpp/trad/comment.c: Likewise. + * gcc.dg/cpp/trad/defined.c: Likewise. + * gcc.dg/cpp/trad/directive.c: Likewise. + * gcc.dg/cpp/trad/funlike-3.c: Likewise. + * gcc.dg/cpp/trad/funlike.c: Likewise. + * gcc.dg/cpp/trad/literals-2.c: Likewise. + * gcc.dg/cpp/trad/macro.c: Likewise. + * gcc.dg/cpp/trad/pr65238-4.c: Likewise. + * gcc.dg/cpp/trad/recurse-1.c: Likewise. + * gcc.dg/cpp/trad/recurse-2.c: Likewise. + * gcc.dg/cpp/trad/redef2.c: Likewise. + * gcc.dg/cpp/ucnid-11.c: Likewise. + * gcc.dg/cpp/unc1.c: Likewise. + * gcc.dg/cpp/unc2.c: Likewise. + * gcc.dg/cpp/unc3.c: Likewise. + * gcc.dg/cpp/unc4.c: Likewise. + * gcc.dg/cpp/undef2.c: Likewise. + * gcc.dg/cpp/warn-redefined-2.c: Likewise. + * gcc.dg/cpp/warn-redefined.c: Likewise. + * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. + * gcc.dg/cpp/warn-unused-macros.c: Likewise. + * gcc.dg/empty-source-2.c: Likewise. + * gcc.dg/empty-source-3.c: Likewise. + * gcc.dg/gomp/macro-4.c: Likewise. + * gcc.dg/noncompile/pr35447-1.c: Likewise. + * gcc.dg/plugin/location-overflow-test-1.c: Likewise. + * gcc.dg/pr20245-1.c: Likewise. + * gcc.dg/pr28419.c: Likewise. + * gcc.dg/rtl/truncated-rtl-file.c: Likewise. + * gcc.dg/unclosed-init.c: Likewise. + 2017-11-13 Charles Baylis - * gfortran.dg/ieee/ieee_8.f90: xfail for aarch64*-*-gnu* + * gfortran.dg/ieee/ieee_8.f90: xfail for aarch64*-*-gnu* 2017-11-13 Jakub Jelinek diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c index 214c6be1e94..bb722811202 100644 --- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c +++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) _Cilk_for (int ii = 0; ii < 10; ii++) Array1[ii] = 0; -#pragma cilk grainsiz = 2 /* { dg-warning "ignoring #pragma cilk grainsiz" } */ +#pragma cilk grainsiz = 2 /* { dg-warning "-:ignoring #pragma cilk grainsiz" } */ _Cilk_for (int ii = 0; ii < 10; ii++) Array1[ii] = 0; diff --git a/gcc/testsuite/c-c++-common/cpp/pr58844-1.c b/gcc/testsuite/c-c++-common/cpp/pr58844-1.c index 3abf8a76803..2a2e277b0fc 100644 --- a/gcc/testsuite/c-c++-common/cpp/pr58844-1.c +++ b/gcc/testsuite/c-c++-common/cpp/pr58844-1.c @@ -4,5 +4,5 @@ #define A x######x int A = 1; -#define A x######x /* { dg-message "previous definition" } */ -#define A x##x /* { dg-warning "redefined" } */ +#define A x######x /* { dg-message "-:previous definition" } */ +#define A x##x /* { dg-warning "-:redefined" } */ diff --git a/gcc/testsuite/c-c++-common/cpp/pr58844-2.c b/gcc/testsuite/c-c++-common/cpp/pr58844-2.c index 1e219152fc5..52993b314be 100644 --- a/gcc/testsuite/c-c++-common/cpp/pr58844-2.c +++ b/gcc/testsuite/c-c++-common/cpp/pr58844-2.c @@ -4,5 +4,5 @@ #define A x######x int A = 1; -#define A x######x /* { dg-message "previous definition" } */ -#define A x##x /* { dg-warning "redefined" } */ +#define A x######x /* { dg-message "-:previous definition" } */ +#define A x##x /* { dg-warning "-:redefined" } */ diff --git a/gcc/testsuite/c-c++-common/cpp/warning-zero-location.c b/gcc/testsuite/c-c++-common/cpp/warning-zero-location.c index 2b9c9a95217..57544b6aff1 100644 --- a/gcc/testsuite/c-c++-common/cpp/warning-zero-location.c +++ b/gcc/testsuite/c-c++-common/cpp/warning-zero-location.c @@ -3,6 +3,6 @@ { dg-do compile } */ -#define _GNU_SOURCE /* { dg-warning "redefined" } */ +#define _GNU_SOURCE /* { dg-warning "-:redefined" } */ /* { dg-message "" "#define _GNU_SOURCE" {target *-*-* } 0 } */ diff --git a/gcc/testsuite/g++.dg/diagnostic/pr77949.C b/gcc/testsuite/g++.dg/diagnostic/pr77949.C index 0d8b333a2ad..b81d6e2bb46 100644 --- a/gcc/testsuite/g++.dg/diagnostic/pr77949.C +++ b/gcc/testsuite/g++.dg/diagnostic/pr77949.C @@ -4,4 +4,4 @@ /* Very long line, where a missing semicolon would be suggested for insertion at column 4097. */ class test { } -// { dg-error "0: expected .;. after class definition" "" { target *-*-* } .-1 } +// { dg-error "-: expected .;. after class definition" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/g++.dg/gomp/macro-4.C b/gcc/testsuite/g++.dg/gomp/macro-4.C index 9fc45b143d5..6a69f1a3ca1 100644 --- a/gcc/testsuite/g++.dg/gomp/macro-4.C +++ b/gcc/testsuite/g++.dg/gomp/macro-4.C @@ -10,9 +10,9 @@ void bar (void); void foo (void) { -#pragma omp p // { dg-warning "ignoring #pragma omp _Pragma" } +#pragma omp p // { dg-warning "-:ignoring #pragma omp _Pragma" } bar (); - omp_p // { dg-warning "ignoring #pragma omp _Pragma" } + omp_p // { dg-warning "-:ignoring #pragma omp _Pragma" } bar (); } @@ -22,8 +22,8 @@ foo (void) void baz (void) { -#pragma omp parallel // { dg-warning "ignoring #pragma omp serial" } +#pragma omp parallel // { dg-warning "-:ignoring #pragma omp serial" } bar (); - omp_parallel // { dg-warning "ignoring #pragma omp serial" } + omp_parallel // { dg-warning "-:ignoring #pragma omp serial" } bar (); } diff --git a/gcc/testsuite/gcc.dg/Wunknownprag.c b/gcc/testsuite/gcc.dg/Wunknownprag.c index c5ba58f767d..3514825a97e 100644 --- a/gcc/testsuite/gcc.dg/Wunknownprag.c +++ b/gcc/testsuite/gcc.dg/Wunknownprag.c @@ -5,7 +5,7 @@ /* We used to get "unspellable token: CPP_EOF" warnings. */ -#pragma /* { dg-warning "ignoring #pragma" } */ -#pragma ~ /* { dg-warning "ignoring #pragma" } */ -#pragma baz /* { dg-warning "ignoring #pragma" } */ -#pragma baz baz /* { dg-warning "ignoring #pragma" } */ +#pragma /* { dg-warning "-:ignoring #pragma" } */ +#pragma ~ /* { dg-warning "-:ignoring #pragma" } */ +#pragma baz /* { dg-warning "-:ignoring #pragma" } */ +#pragma baz baz /* { dg-warning "-:ignoring #pragma" } */ diff --git a/gcc/testsuite/gcc.dg/builtin-redefine.c b/gcc/testsuite/gcc.dg/builtin-redefine.c index 8090015f693..882b2210992 100644 --- a/gcc/testsuite/gcc.dg/builtin-redefine.c +++ b/gcc/testsuite/gcc.dg/builtin-redefine.c @@ -27,8 +27,8 @@ #define __TIME__ "X" /* Define while undefined. */ #define __TIME__ "X" /* Re-define while defined. */ /* { dg-line time_prev } */ -#define __TIME__ "Y" /* { dg-warning "\"__TIME__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } time_prev } */ +#define __TIME__ "Y" /* { dg-warning "-:\"__TIME__\" redefined" } */ +/* { dg-message "-:previous definition" "" { target *-*-* } time_prev } */ #undef __TIME__ /* Undefine while defined. */ @@ -38,8 +38,8 @@ #define __DATE__ "X" /* Define while undefined. */ #define __DATE__ "X" /* Re-define while defined. */ /* { dg-line date_prev } */ -#define __DATE__ "Y" /* { dg-warning "\"__DATE__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } date_prev } */ +#define __DATE__ "Y" /* { dg-warning "-:\"__DATE__\" redefined" } */ +/* { dg-message "-:previous definition" "" { target *-*-* } date_prev } */ #undef __DATE__ /* Undefine while defined. */ @@ -47,8 +47,8 @@ #define __TIMESTAMP__ "X" /* Define while already defined. */ #define __TIMESTAMP__ "X" /* Re-define while defined. */ /* { dg-line timestamp_prev } */ -#define __TIMESTAMP__ "Y" /* { dg-warning "\"__TIMESTAMP__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } timestamp_prev } */ +#define __TIMESTAMP__ "Y" /* { dg-warning "-:\"__TIMESTAMP__\" redefined" } */ +/* { dg-message "-:previous definition" "" { target *-*-* } timestamp_prev } */ #undef __TIMESTAMP__ /* Undefine while defined. */ @@ -71,9 +71,9 @@ /* { dg-bogus "Expected built-in is not defined" "" { target *-*-* } .-1 } */ #endif -#define __LINE__ 0 /* { dg-warning "\"__LINE__\" redef" } */ -#define __INCLUDE_LEVEL__ 0 /* { dg-warning "\"__INCLUDE_LEVEL__\" redef" } */ -#define __COUNTER__ 0 /* { dg-warning "\"__COUNTER__\" redef" } */ +#define __LINE__ 0 /* { dg-warning "-:\"__LINE__\" redef" } */ +#define __INCLUDE_LEVEL__ 0 /* { dg-warning "-:\"__INCLUDE_LEVEL__\" redef" } */ +#define __COUNTER__ 0 /* { dg-warning "-:\"__COUNTER__\" redef" } */ int unused; /* Silence `ISO C forbids an empty translation unit' warning. */ diff --git a/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c b/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c index 4f6a04be45a..06a244e097d 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c +++ b/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c @@ -5,25 +5,25 @@ /* Make sure we get warnings in the expected lines. */ -#pragma unknown1 /* { dg-warning "unknown1" "unknown1" } */ +#pragma unknown1 /* { dg-warning "-:unknown1" "unknown1" } */ #define COMMA , #define FOO(x) x #define BAR(x) _Pragma("unknown_before") x #define BAZ(x) x _Pragma("unknown_after") -int _Pragma("unknown2") bar1; /* { dg-warning "unknown2" "unknown2" } */ +int _Pragma("unknown2") bar1; /* { dg-warning "-:unknown2" "unknown2" } */ -FOO(int _Pragma("unknown3") bar2); /* { dg-warning "unknown3" "unknown3" } */ +FOO(int _Pragma("unknown3") bar2); /* { dg-warning "-:unknown3" "unknown3" } */ -int BAR(bar3); /* { dg-warning "unknown_before" "unknown_before 1" } */ +int BAR(bar3); /* { dg-warning "-:unknown_before" "unknown_before 1" } */ -BAR(int bar4); /* { dg-warning "unknown_before" "unknown_before 2" } */ +BAR(int bar4); /* { dg-warning "-:unknown_before" "unknown_before 2" } */ -int BAZ(bar5); /* { dg-warning "unknown_after" "unknown_after 1" } */ +int BAZ(bar5); /* { dg-warning "-:unknown_after" "unknown_after 1" } */ -int BAZ(bar6;) /* { dg-warning "unknown_after" "unknown_after 2" } */ +int BAZ(bar6;) /* { dg-warning "-:unknown_after" "unknown_after 2" } */ -FOO(int bar7; _Pragma("unknown4")) /* { dg-warning "unknown4" "unknown4" } */ +FOO(int bar7; _Pragma("unknown4")) /* { dg-warning "-:unknown4" "unknown4" } */ -#pragma unknown5 /* { dg-warning "unknown5" "unknown5" } */ +#pragma unknown5 /* { dg-warning "-:unknown5" "unknown5" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/Wunused.c b/gcc/testsuite/gcc.dg/cpp/Wunused.c index ac363ad04b8..d6f76288cd7 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wunused.c +++ b/gcc/testsuite/gcc.dg/cpp/Wunused.c @@ -15,9 +15,9 @@ #define used3 /* { dg-bogus "used" } */ #define used4 used4 /* { dg-bogus "used" } */ -#define unused5 /* { dg-warning "used" } */ -#define unused6 /* { dg-warning "used" } */ -#define unused7() /* { dg-warning "used" } */ +#define unused5 /* { dg-warning "-:used" } */ +#define unused6 /* { dg-warning "-:used" } */ +#define unused7() /* { dg-warning "-:used" } */ #if defined used1 #endif diff --git a/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c b/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c index f79670a17cb..d4176144f5d 100644 --- a/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c +++ b/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c @@ -1,4 +1,4 @@ -#ifndef SOME_GUARD /* { dg-error "unterminated" } */ +#ifndef SOME_GUARD /* { dg-error "-:unterminated" } */ #if 1 /* Typo here: "endfi" should have been "endif". */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef2.c b/gcc/testsuite/gcc.dg/cpp/redef2.c index 1dbc10033ed..439d33a7057 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef2.c +++ b/gcc/testsuite/gcc.dg/cpp/redef2.c @@ -17,15 +17,15 @@ #define foo(x) x #define foo(x)x /* { dg-bogus "redefined" "redefined foo" } */ -/* { dg-warning "redefined" "redef mac" { target *-*-* } 7 } - { dg-warning "redefined" "redef mac" { target *-*-* } 8 } - { dg-warning "redefined" "redef mac" { target *-*-* } 9 } - { dg-warning "redefined" "redef ro" { target *-*-* } 12 } - { dg-warning "redefined" "redef va" { target *-*-* } 15 } +/* { dg-warning "-:redefined" "redef mac" { target *-*-* } 7 } + { dg-warning "-:redefined" "redef mac" { target *-*-* } 8 } + { dg-warning "-:redefined" "redef mac" { target *-*-* } 9 } + { dg-warning "-:redefined" "redef ro" { target *-*-* } 12 } + { dg-warning "-:redefined" "redef va" { target *-*-* } 15 } - { dg-message "previous" "prev def mac" { target *-*-* } 6 } - { dg-message "previous" "prev def mac" { target *-*-* } 7 } - { dg-message "previous" "prev def mac" { target *-*-* } 8 } - { dg-message "previous" "prev def ro" { target *-*-* } 11 } - { dg-message "previous" "prev def va" { target *-*-* } 14 } + { dg-message "-:previous" "prev def mac" { target *-*-* } 6 } + { dg-message "-:previous" "prev def mac" { target *-*-* } 7 } + { dg-message "-:previous" "prev def mac" { target *-*-* } 8 } + { dg-message "-:previous" "prev def ro" { target *-*-* } 11 } + { dg-message "-:previous" "prev def va" { target *-*-* } 14 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef3.c b/gcc/testsuite/gcc.dg/cpp/redef3.c index 1c541a45bb1..4e4ef128b10 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef3.c +++ b/gcc/testsuite/gcc.dg/cpp/redef3.c @@ -11,11 +11,11 @@ #define D 1 2 #define E -/* { dg-warning "redefined" "redef A" { target *-*-* } 7 } - { dg-warning "redefined" "redef B" { target *-*-* } 9 } - { dg-warning "redefined" "redef D" { target *-*-* } 11 } - { dg-warning "redefined" "redef E" { target *-*-* } 12 } - { dg-message "previous" "prev def A" { target *-*-* } 6 } - { dg-message "previous" "prev def B" { target *-*-* } 8 } - { dg-message "previous" "prev def D/E" { target *-*-* } 0 } +/* { dg-warning "-:redefined" "redef A" { target *-*-* } 7 } + { dg-warning "-:redefined" "redef B" { target *-*-* } 9 } + { dg-warning "-:redefined" "redef D" { target *-*-* } 11 } + { dg-warning "-:redefined" "redef E" { target *-*-* } 12 } + { dg-message "-:previous" "prev def A" { target *-*-* } 6 } + { dg-message "-:previous" "prev def B" { target *-*-* } 8 } + { dg-message "-:previous" "prev def D/E" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef4.c b/gcc/testsuite/gcc.dg/cpp/redef4.c index b34635b2e42..aa6729b770b 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef4.c +++ b/gcc/testsuite/gcc.dg/cpp/redef4.c @@ -4,41 +4,41 @@ /* { dg-do preprocess } */ /* { dg-options "" } */ -#define str(x) #x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) #x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) #x /* { dg-message "previous definition" } */ -#define str(x) # x /* { dg-warning "redefined" } */ +#define str(x) #x /* { dg-message "-:previous definition" } */ +#define str(x) # x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) #x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) #x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) #x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) #x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) # x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) # x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) # x /* { dg-message "previous definition" } */ -#define str(x) #x /* { dg-warning "redefined" } */ +#define str(x) # x /* { dg-message "-:previous definition" } */ +#define str(x) #x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) # x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) # x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) # x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) # x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %: x /* { dg-message "previous definition" } */ -#define str(x) #x /* { dg-warning "redefined" } */ +#define str(x) %: x /* { dg-message "-:previous definition" } */ +#define str(x) #x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %: x /* { dg-message "previous definition" } */ -#define str(x) # x /* { dg-warning "redefined" } */ +#define str(x) %: x /* { dg-message "-:previous definition" } */ +#define str(x) # x /* { dg-warning "-:redefined" } */ #undef str #define str(x) #x @@ -54,173 +54,173 @@ #define str(x) %: x #undef str -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr #define astr(x) a#x @@ -248,173 +248,173 @@ #define astr(x) a %: x #undef astr -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat #define cat(x,y) x##y @@ -442,28 +442,28 @@ #define cat(x,y) x %:%: y #undef cat -#define cat3(x,y,z) x##y##z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y####z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y##z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y####z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x####y##z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x####y##z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y## ##z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y## ##z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y##%:%:z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y##%:%:z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y######## ####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y############z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y######## ####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y############z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y############z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y########%:%:##z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y############z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y########%:%:##z /* { dg-warning "-:redefined" } */ #undef cat3 #define cat3(x,y,z) x##y##z diff --git a/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c b/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c index 403d617f5d0..97465f3967c 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c @@ -14,9 +14,9 @@ #define used3 /* { dg-bogus "used" } */ #define used4 something /* { dg-bogus "used" } */ -#define unused5 /* { dg-warning "used" } */ -#define unused6 /* { dg-warning "used" } */ -#define unused7() /* { dg-warning "used" } */ +#define unused5 /* { dg-warning "-:used" } */ +#define unused6 /* { dg-warning "-:used" } */ +#define unused7() /* { dg-warning "-:used" } */ #if defined used1 #endif diff --git a/gcc/testsuite/gcc.dg/cpp/trad/argcount.c b/gcc/testsuite/gcc.dg/cpp/trad/argcount.c index 208cd44b3b0..7098caf7d76 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/argcount.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/argcount.c @@ -7,15 +7,15 @@ #define g(x, y) x y #define h() -f(); /* { dg-bogus "requires 1" "no arg is 1 empty arg" } */ -f( ); /* { dg-bogus "macro" "1 arg to 1 param macro" } */ -f(1,); /* { dg-error "passed 2" "2 args to 1 param macro" } */ -f(1,2); /* { dg-error "passed 2" "2 args to 1 param macro" } */ -h(); /* { dg-bogus "macro" "no arg to 1 param macro" } */ -h( ); /* { dg-error "passed 1" "1 arg to 0 param macro" } */ -h(1,2); /* { dg-error "passed 2" "2 args to 0 param macro" } */ -g(); /* { dg-error "requires 2" "0 args to 2 param macro" } */ -g( ); /* { dg-error "requires 2" "1 args to 2 param macro" } */ -g( ,2); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */ -g(,); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */ -g(1,2,3); /* { dg-error "passed 3" "3 args to 2 param macro" } */ +f(); /* { dg-bogus "-:requires 1" "no arg is 1 empty arg" } */ +f( ); /* { dg-bogus "-:macro" "1 arg to 1 param macro" } */ +f(1,); /* { dg-error "-:passed 2" "2 args to 1 param macro" } */ +f(1,2); /* { dg-error "-:passed 2" "2 args to 1 param macro" } */ +h(); /* { dg-bogus "-:macro" "no arg to 1 param macro" } */ +h( ); /* { dg-error "-:passed 1" "1 arg to 0 param macro" } */ +h(1,2); /* { dg-error "-:passed 2" "2 args to 0 param macro" } */ +g(); /* { dg-error "-:requires 2" "0 args to 2 param macro" } */ +g( ); /* { dg-error "-:requires 2" "1 args to 2 param macro" } */ +g( ,2); /* { dg-bogus "-:requires 2" "2 args to 2 param macro" } */ +g(,); /* { dg-bogus "-:requires 2" "2 args to 2 param macro" } */ +g(1,2,3); /* { dg-error "-:passed 3" "3 args to 2 param macro" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c index e2710ad5629..7d1d8252f01 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c @@ -3,4 +3,4 @@ /* { dg-do preprocess } */ #if 0 -#endif // /* { dg-warning "extra tokens" } */ +#endif // /* { dg-warning "-:extra tokens" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment.c b/gcc/testsuite/gcc.dg/cpp/trad/comment.c index 971a78a6d10..36fa90d3f37 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/comment.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/comment.c @@ -2,4 +2,4 @@ /* { dg-do preprocess } */ -/* { dg-error "unterminated comment" } +/* { dg-error "-:unterminated comment" } diff --git a/gcc/testsuite/gcc.dg/cpp/trad/defined.c b/gcc/testsuite/gcc.dg/cpp/trad/defined.c index 5fa1d93b8aa..fa4c4119d3d 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/defined.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/defined.c @@ -16,7 +16,7 @@ #error REGPARMS should be defined #endif -#define defined /* { dg-error "defined" } */ +#define defined /* { dg-error "-:defined" } */ /* No diagnostics, though you could argue there should be. */ #if defined defined diff --git a/gcc/testsuite/gcc.dg/cpp/trad/directive.c b/gcc/testsuite/gcc.dg/cpp/trad/directive.c index ee7ebcab031..0a42df62639 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/directive.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/directive.c @@ -12,7 +12,7 @@ HASH /* Directives with their #s indented are not recognized. */ #if 0 /* { dg-bogus "unterminated" } */ -#wrong /* { dg-error "invalid" } */ +#wrong /* { dg-error "-:invalid" } */ #define foo 2 #define bar + 3 diff --git a/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c b/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c index 5300afba708..2baa99a31c3 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c @@ -5,8 +5,8 @@ #define f(x) x -#if 2 f(/* { dg-error "unterminated" "unterminated macro in directive" } */ +#if 2 f(/* { dg-error "-:unterminated" "unterminated macro in directive" } */ ) #endif -f( /* { dg-error "unterminated" "unterminated macro" } */ +f( /* { dg-error "-:unterminated" "unterminated macro" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/funlike.c b/gcc/testsuite/gcc.dg/cpp/trad/funlike.c index db550d53c76..1af6f9fcf97 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/funlike.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/funlike.c @@ -21,5 +21,5 @@ # error /* { dg-bogus "error" "empty macro" } */ #endif -#if f paren 6) /* { dg-error "missing binary" "macro-expanded parenthesis" } */ +#if f paren 6) /* { dg-error "-:missing binary" "macro-expanded parenthesis" } */ #endif diff --git a/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c b/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c index faa7bd87674..a6f9637c640 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c @@ -2,7 +2,7 @@ recognized. */ /* { dg-do preprocess } */ -/* { dg-warning "missing terminating" "bad charconst" { target *-*-* } .+2 } */ -/* { dg-error "not valid" "bad charconst" { target *-*-* } .+1 } */ +/* { dg-warning "-:missing terminating" "bad charconst" { target *-*-* } .+2 } */ +/* { dg-error "-:not valid" "bad charconst" { target *-*-* } .+1 } */ #if 'x #endif diff --git a/gcc/testsuite/gcc.dg/cpp/trad/macro.c b/gcc/testsuite/gcc.dg/cpp/trad/macro.c index 164b4ecfee6..6f8aa9ac239 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/macro.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/macro.c @@ -4,7 +4,7 @@ /* { dg-do preprocess } */ #define f(x) -#define g(x, y...) /* { dg-error "macro parameter list" } */ +#define g(x, y...) /* { dg-error "-:macro parameter list" } */ #if 0 #define f(a,b) /* { dg-bogus "passed 2 arguments" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c b/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c index cf2f449133c..3cee7b9888b 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c @@ -11,9 +11,9 @@ #if __has_attribute(__has_attribute(unused)) #endif -/* { dg-error "unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 5 } */ -/* { dg-error "#if with no expression" "" {target "*-*-*"} 5 } */ -/* { dg-error "unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 7 } */ -/* { dg-error "macro .__has_attribute. passed 2 arguments, but takes just 1" "" {target "*-*-*"} 9 } */ -/* { dg-error "missing ... in expression" "" {target "*-*-*"} 9 } */ -/* { dg-error "macro .__has_attribute. requires an identifier" "" {target "*-*-*"} 11 } */ +/* { dg-error "-:unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 5 } */ +/* { dg-error "-:#if with no expression" "" {target "*-*-*"} 5 } */ +/* { dg-error "-:unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 7 } */ +/* { dg-error "-:macro .__has_attribute. passed 2 arguments, but takes just 1" "" {target "*-*-*"} 9 } */ +/* { dg-error "-:missing ... in expression" "" {target "*-*-*"} 9 } */ +/* { dg-error "-:macro .__has_attribute. requires an identifier" "" {target "*-*-*"} 11 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c b/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c index b5fd7af7f5f..31c020bad87 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c @@ -4,7 +4,7 @@ /* { dg-do preprocess } */ #define foo foo -foo /* { dg-error "detected recursion" } */ +foo /* { dg-error "-:detected recursion" } */ #define bar a bar b -bar /* { dg-error "detected recursion" } */ +bar /* { dg-error "-:detected recursion" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c b/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c index 5c6550fae2a..3e5929d5a04 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c @@ -4,13 +4,13 @@ /* { dg-do preprocess } */ #define foo() foo() -foo(); /* { dg-error "detected recursion" } */ +foo(); /* { dg-error "-:detected recursion" } */ #define bar() bar baz() bar bar(); /* { dg-bogus "detected recursion" } */ #define baz() foo() -baz(); /* { dg-error "detected recursion" } */ +baz(); /* { dg-error "-:detected recursion" } */ #define a(x) x(a) -a(a); /* { dg-error "detected recursion" } */ +a(a); /* { dg-error "-:detected recursion" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/redef2.c b/gcc/testsuite/gcc.dg/cpp/trad/redef2.c index 5fcd5eb32e8..ad10b86fd3d 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/redef2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/redef2.c @@ -2,31 +2,31 @@ /* { dg-do preprocess } */ -#define foo bar /* { dg-message "previous def" "foo prev def" } */ -#define foo barr /* { dg-warning "redefined" "foo redefined" } */ +#define foo bar /* { dg-message "-:previous def" "foo prev def" } */ +#define foo barr /* { dg-warning "-:redefined" "foo redefined" } */ #undef foo -#define foo bar /* { dg-message "previous def" "foo prev def 2" } */ -#define foo() bar /* { dg-warning "redefined" "foo redefined 2" } */ +#define foo bar /* { dg-message "-:previous def" "foo prev def 2" } */ +#define foo() bar /* { dg-warning "-:redefined" "foo redefined 2" } */ #undef foo -#define foo() bar /* { dg-message "previous def" "foo prev def" } */ -#define foo() barr /* { dg-warning "redefined" "foo redefined" } */ +#define foo() bar /* { dg-message "-:previous def" "foo prev def" } */ +#define foo() barr /* { dg-warning "-:redefined" "foo redefined" } */ -#define quux(thud) a thud b /* { dg-message "previous def" "quux prev def" } */ -#define quux(thu) a thud b /* { dg-warning "redefined" "quux redefined" } */ +#define quux(thud) a thud b /* { dg-message "-:previous def" "quux prev def" } */ +#define quux(thu) a thud b /* { dg-warning "-:redefined" "quux redefined" } */ -#define bar(x, y) x+y /* { dg-message "previous def" "bar prev def" } */ -#define bar(x, y) x+x /* { dg-warning "redefined" "bar redefined" } */ +#define bar(x, y) x+y /* { dg-message "-:previous def" "bar prev def" } */ +#define bar(x, y) x+x /* { dg-warning "-:redefined" "bar redefined" } */ -#define bat(x, y) x+y /* { dg-message "previous def" "bat prev def" } */ -#define bat(x, y) x+ y /* { dg-warning "redefined" "bat redefined" } */ +#define bat(x, y) x+y /* { dg-message "-:previous def" "bat prev def" } */ +#define bat(x, y) x+ y /* { dg-warning "-:redefined" "bat redefined" } */ -#define baz(x, y) x+y /* { dg-message "previous def" "baz prev def" } */ -#define baz(x, y) x +y /* { dg-warning "redefined" "baz redefined" } */ +#define baz(x, y) x+y /* { dg-message "-:previous def" "baz prev def" } */ +#define baz(x, y) x +y /* { dg-warning "-:redefined" "baz redefined" } */ -#define f(x, y) "x y" /* { dg-message "previous def" "f prev def" } */ -#define f(x, y) "x y" /* { dg-warning "redefined" "f redefined" } */ +#define f(x, y) "x y" /* { dg-message "-:previous def" "f prev def" } */ +#define f(x, y) "x y" /* { dg-warning "-:redefined" "f redefined" } */ -#define g(x, y) 'x' /* { dg-message "previous def" "g prev def" } */ -#define g(x, y) ' x' /* { dg-warning "redefined" "g redefined" } */ +#define g(x, y) 'x' /* { dg-message "-:previous def" "g prev def" } */ +#define g(x, y) ' x' /* { dg-warning "-:redefined" "g redefined" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-11.c b/gcc/testsuite/gcc.dg/cpp/ucnid-11.c index a44a3eaf421..b6956f54454 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-11.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-11.c @@ -4,23 +4,23 @@ /* { dg-options "-std=c99 -pedantic-errors" } */ /* Different spelling of UCN in expansion. */ -#define m1 \u00c1 /* { dg-message "previous definition" } */ -#define m1 \u00C1 /* { dg-error "redefined" } */ +#define m1 \u00c1 /* { dg-message "-:previous definition" } */ +#define m1 \u00C1 /* { dg-error "-:redefined" } */ #define m1ok \u00c1 #define m1ok \u00c1 /* Different spelling of UCN in argument name. */ -#define m2(\u00c1) /* { dg-message "previous definition" } */ -#define m2(\u00C1) /* { dg-error "redefined" } */ +#define m2(\u00c1) /* { dg-message "-:previous definition" } */ +#define m2(\u00C1) /* { dg-error "-:redefined" } */ #define m2ok(\u00c1) #define m2ok(\u00c1) /* Same spelling in argument name but different spelling when used in expansion. */ -#define m3(\u00c1) \u00c1 /* { dg-message "previous definition" } */ -#define m3(\u00c1) \u00C1 /* { dg-error "redefined" } */ +#define m3(\u00c1) \u00c1 /* { dg-message "-:previous definition" } */ +#define m3(\u00c1) \u00C1 /* { dg-error "-:redefined" } */ #define m3ok(\u00c1) \u00C1 #define m3ok(\u00c1) \u00C1 diff --git a/gcc/testsuite/gcc.dg/cpp/unc1.c b/gcc/testsuite/gcc.dg/cpp/unc1.c index 18c306fc89e..d8eb1923103 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc1.c +++ b/gcc/testsuite/gcc.dg/cpp/unc1.c @@ -1,7 +1,7 @@ /* Tests for un-terminated conditionals: 1. */ /* { dg-do preprocess } */ -#if 1 /* { dg-error "unterminated" "unterminated #if" } */ +#if 1 /* { dg-error "-:unterminated" "unterminated #if" } */ #ifdef notdef /* { dg-bogus "unterminated" "nested terminated #ifdef" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/unc2.c b/gcc/testsuite/gcc.dg/cpp/unc2.c index 976d2b181ab..faa4b2905b4 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc2.c +++ b/gcc/testsuite/gcc.dg/cpp/unc2.c @@ -1,7 +1,7 @@ /* Tests for unterminated conditionals: 2. */ /* { dg-do preprocess } */ -#ifdef __sparc__ /* { dg-error "unterminated" "unterminated if-elif-elif..." } */ +#ifdef __sparc__ /* { dg-error "-:unterminated" "unterminated if-elif-elif..." } */ sparc #elif defined __powerpc__ ppc diff --git a/gcc/testsuite/gcc.dg/cpp/unc3.c b/gcc/testsuite/gcc.dg/cpp/unc3.c index d5f16f738ac..e20339cf809 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc3.c +++ b/gcc/testsuite/gcc.dg/cpp/unc3.c @@ -1,5 +1,5 @@ /* Tests for unterminated conditionals: 3. */ /* { dg-do preprocess } */ -#if 1 /* { dg-error "#else" "unterminated #else" } */ +#if 1 /* { dg-error "-:#else" "unterminated #else" } */ #else diff --git a/gcc/testsuite/gcc.dg/cpp/unc4.c b/gcc/testsuite/gcc.dg/cpp/unc4.c index 10c49e9d4db..410e2fcda0c 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc4.c +++ b/gcc/testsuite/gcc.dg/cpp/unc4.c @@ -36,4 +36,4 @@ ignored /* dg.exp doesn't read the included files for tags, so we have to do them explicitly here. */ -/* { dg-error "#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */ +/* { dg-error "-:#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/undef2.c b/gcc/testsuite/gcc.dg/cpp/undef2.c index 5614e039b22..189a72dd9c2 100644 --- a/gcc/testsuite/gcc.dg/cpp/undef2.c +++ b/gcc/testsuite/gcc.dg/cpp/undef2.c @@ -3,11 +3,11 @@ /* { dg-do preprocess } */ -#undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */ -#undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */ -#undef __FILE__ /* { dg-warning "undefining" "__FILE__" } */ -#undef __LINE__ /* { dg-warning "undefining" "__LINE__" } */ -#undef __STDC__ /* { dg-warning "undefining" "__STDC__" } */ +#undef __DATE__ /* { dg-warning "-:undefining \"__DATE__\"" } */ +#undef __TIME__ /* { dg-warning "-:undefining \"__TIME__\"" } */ +#undef __FILE__ /* { dg-warning "-:undefining \"__FILE__\"" } */ +#undef __LINE__ /* { dg-warning "undefining \"__LINE__\"" } */ +#undef __STDC__ /* { dg-warning "undefining \"__STDC__\"" } */ /* These should be protected from #undef, but aren't, because they are set with normal #define commands - and on top of that, some diff --git a/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c b/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c index 3e2e57a79bb..ea5ad8170cd 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c @@ -6,13 +6,13 @@ // { dg-bogus "__TIME__ builtin is not defined" "no-time" { target *-*-* } .-1 } #endif -#define __TIME__ "X" // { dg-error "\"__TIME__\" redefined .-Werror=builtin-macro-redefined." } +#define __TIME__ "X" // { dg-error "-:\"__TIME__\" redefined .-Werror=builtin-macro-redefined." } #define __TIME__ "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-1" { target *-*-* } 9 } + // { dg-warning "-:\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-1" { target *-*-* } 9 } #define X "X" #define X "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-2" { target *-*-* } 15 } + // { dg-warning "-:\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-2" { target *-*-* } 15 } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-redefined.c b/gcc/testsuite/gcc.dg/cpp/warn-redefined.c index c562d072e40..e0446689706 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-redefined.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-redefined.c @@ -6,13 +6,13 @@ // { dg-bogus "__TIME__ builtin is not defined" "no-time" { target *-*-* } .-1 } #endif -#define __TIME__ "X" // { dg-warning "\"__TIME__\" redefined .-Wbuiltin-macro-redefined." } +#define __TIME__ "X" // { dg-warning "-:\"__TIME__\" redefined .-Wbuiltin-macro-redefined." } #define __TIME__ "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-1" { target *-*-* } 9 } + // { dg-warning "-:\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-1" { target *-*-* } 9 } #define X "X" #define X "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-2" { target *-*-* } 15 } + // { dg-warning "-:\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-2" { target *-*-* } 15 } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c index d7fe145c8cc..f82d67fe9c2 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c @@ -1,4 +1,4 @@ // { dg-do preprocess } // { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=unused-macros" } /* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ -#define X X // { dg-error "macro \"X\" is not used .-Werror=unused-macros." } +#define X X // { dg-error "-:macro \"X\" is not used .-Werror=unused-macros." } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c index e1ce94eeee6..b18f506b13b 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c @@ -1,4 +1,4 @@ // { dg-do preprocess } // { dg-options "-std=gnu99 -fdiagnostics-show-option -Wunused-macros" } -#define X X // { dg-warning "macro \"X\" is not used .-Wunused-macros." } +#define X X // { dg-warning "-:macro \"X\" is not used .-Wunused-macros." } diff --git a/gcc/testsuite/gcc.dg/empty-source-2.c b/gcc/testsuite/gcc.dg/empty-source-2.c index ae36159b5af..e0180ec9475 100644 --- a/gcc/testsuite/gcc.dg/empty-source-2.c +++ b/gcc/testsuite/gcc.dg/empty-source-2.c @@ -3,4 +3,4 @@ /* { dg-do compile } */ /* { dg-options "-pedantic" } */ -/* { dg-warning "ISO C forbids an empty translation unit" "empty" } */ +/* { dg-warning "-:ISO C forbids an empty translation unit" "empty" } */ diff --git a/gcc/testsuite/gcc.dg/empty-source-3.c b/gcc/testsuite/gcc.dg/empty-source-3.c index bcd76ac2905..f8c58b3ef3f 100644 --- a/gcc/testsuite/gcc.dg/empty-source-3.c +++ b/gcc/testsuite/gcc.dg/empty-source-3.c @@ -4,4 +4,4 @@ /* { dg-do compile } */ /* { dg-options "-pedantic-errors" } */ -/* { dg-error "ISO C forbids an empty translation unit" "empty" } */ +/* { dg-error "-:ISO C forbids an empty translation unit" "empty" } */ diff --git a/gcc/testsuite/gcc.dg/gomp/macro-4.c b/gcc/testsuite/gcc.dg/gomp/macro-4.c index 7d20f4cd68d..28d198b1ce3 100644 --- a/gcc/testsuite/gcc.dg/gomp/macro-4.c +++ b/gcc/testsuite/gcc.dg/gomp/macro-4.c @@ -10,9 +10,9 @@ void bar (void); void foo (void) { -#pragma omp p /* { dg-warning "ignoring #pragma omp _Pragma" } */ +#pragma omp p /* { dg-warning "-:ignoring #pragma omp _Pragma" } */ bar (); - omp_p /* { dg-warning "ignoring #pragma omp _Pragma" } */ + omp_p /* { dg-warning "-:ignoring #pragma omp _Pragma" } */ bar (); } @@ -22,8 +22,8 @@ foo (void) void baz (void) { -#pragma omp parallel /* { dg-warning "ignoring #pragma omp serial" } */ +#pragma omp parallel /* { dg-warning "-:ignoring #pragma omp serial" } */ bar (); - omp_parallel /* { dg-warning "ignoring #pragma omp serial" } */ + omp_parallel /* { dg-warning "-:ignoring #pragma omp serial" } */ bar (); } diff --git a/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c b/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c index 9c31e9bb617..b9bbb733fae 100644 --- a/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c @@ -4,4 +4,4 @@ void foo() { ({ int i().; }); /* { dg-error "expected" } */ -} /* { dg-error "expected" } */ +} /* { dg-error "-:expected" } */ diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c index 7983c035862..1a80a668a0f 100644 --- a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c +++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c @@ -5,7 +5,7 @@ numbers are available. */ /* Verify that we're in column-less mode. */ -extern unknown_type test; /* { dg-error "0: unknown type name" } */ +extern unknown_type test; /* { dg-error "-:unknown type name" } */ /* PR c++/68819: verify that -Wmisleading-indentation is suppressed. */ @@ -13,7 +13,7 @@ int fn_1 (int flag) { int x = 4, y = 5; - if (flag) x = 3; y = 2; /* { dg-message "disabled from this point" } */ + if (flag) x = 3; y = 2; /* { dg-message "-:disabled from this point" } */ return x * y; } diff --git a/gcc/testsuite/gcc.dg/pr20245-1.c b/gcc/testsuite/gcc.dg/pr20245-1.c index 51089c6e996..b5767d88b7b 100644 --- a/gcc/testsuite/gcc.dg/pr20245-1.c +++ b/gcc/testsuite/gcc.dg/pr20245-1.c @@ -2,4 +2,4 @@ /* { dg-do compile } */ /* { dg-options "" } */ -void foo() x; /* { dg-error "expected" } */ +void foo() x; /* { dg-error "-:expected" } */ diff --git a/gcc/testsuite/gcc.dg/pr28419.c b/gcc/testsuite/gcc.dg/pr28419.c index a1aa4bfe8db..9974864034b 100644 --- a/gcc/testsuite/gcc.dg/pr28419.c +++ b/gcc/testsuite/gcc.dg/pr28419.c @@ -1,3 +1,4 @@ /* { dg-do compile } */ void foo() const char* p = __FUNCTION__; /* { dg-error "" } */ +/* { dg-error "-:expected" "" } */ diff --git a/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c b/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c index 4dd8214317b..fffb4d7011a 100644 --- a/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c +++ b/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c @@ -1,2 +1,2 @@ void __RTL test (void) -{ /* { dg-error "no closing brace" } */ +{ /* { dg-error "-:no closing brace" } */ diff --git a/gcc/testsuite/gcc.dg/unclosed-init.c b/gcc/testsuite/gcc.dg/unclosed-init.c index c0e4dd8da9b..3deb88e777c 100644 --- a/gcc/testsuite/gcc.dg/unclosed-init.c +++ b/gcc/testsuite/gcc.dg/unclosed-init.c @@ -1,3 +1,3 @@ int unclosed[] = { /* { dg-message "18: to match this '.'" } */ 42 - /* { dg-error "0: expected '.' at end of input" } */ + /* { dg-error "-: expected '.' at end of input" } */ diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index d8f9b7bd2bb..98366dc1fc3 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -1092,24 +1092,27 @@ proc process-message { msgproc msgprefix dgargs } { set newentry [lindex ${dg-messages} end] set expmsg [lindex $newentry 2] + set column "" # Handle column numbers from the specified expression (if there is # one) and set up the search expression that will be used by DejaGnu. - if [regexp "^(\[0-9\]+):" $expmsg "" column] { + if [regexp {^-:} $expmsg] { + # The expected column is -, so shouldn't appear. + set expmsg [string range $expmsg 2 end] + } elseif [regexp {^[0-9]+:} $expmsg column] { # The expression in the directive included a column number. - # Remove "COLUMN:" from the original expression and move it + # Remove it from the original expression and move it # to the proper place in the search expression. - regsub "^\[0-9\]+:" $expmsg "" expmsg - set expmsg "$column: $msgprefix\[^\n\]*$expmsg" + set expmsg [string range $expmsg [string length $column] end] } elseif [string match "" [lindex $newentry 0]] { # The specified line number is 0; don't expect a column number. - set expmsg "$msgprefix\[^\n\]*$expmsg" } else { # There is no column number in the search expression, but we # should expect one in the message itself. - set expmsg "\[0-9\]+: $msgprefix\[^\n\]*$expmsg" + set column {[0-9]+:} } - + set expmsg "$column $msgprefix\[^\n\]*$expmsg" set newentry [lreplace $newentry 2 2 $expmsg] + set dg-messages [lreplace ${dg-messages} end end $newentry] verbose "process-message:\n${dg-messages}" 2 } -- 2.30.2