https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80221
--- Comment #11 from Martin Sebor <msebor at gcc dot gnu.org> ---
That would work too. Yet another possibility is to surround all the dg-message
directives that apply to the same line in a pair of new directives (analogously
to dg-{begin,end}-multiline-output):
foobar;
/* { dg-begin-same-line-output .-1 }
...
{ dg-warning "warning for foobar" }
...
{ dg-message "note for foobar" }
...
{ dg-error "error for foobar" }
...
{ dg-end-same-line-output } */