libgomp testsuite: tell warning from error diagnostics, etc. [PR80219, PR85303]

Jakub Jelinek jakub@redhat.com
Fri Oct 30 11:25:38 GMT 2020


On Fri, Oct 30, 2020 at 12:22:31PM +0100, Thomas Schwinge wrote:
> Turns out that GCC PR85303 "[testsuite, libgomp] dg-message not
> supported" is the very same problem as (the libgomp aspect of) GCC
> PR80219 "relative line numbers only working if gcc_{error,warning}_prefix
> defined" (see rationale in there).  OK to push the attached patch for
> "libgomp testsuite: tell warning from error diagnostics, etc. [PR80219,
> PR85303]"?  This changes makes 'dg-warning', 'dg-error', 'dg-bogus',
> 'dg-message' behave as expected, and also enables use of relative line
> numbers as well as 'dg-line'.  (No testsuite regressions.)

Ok, thanks.

> 	libgomp/
> 	PR testsuite/80219
> 	PR testsuite/85303
> 	* testsuite/lib/libgomp.exp (libgomp_init): Set
> 	'gcc_warning_prefix', 'gcc_error_prefix'.
> ---
>  libgomp/testsuite/lib/libgomp.exp | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
> index 5d86e2ac095f..72d001186a57 100644
> --- a/libgomp/testsuite/lib/libgomp.exp
> +++ b/libgomp/testsuite/lib/libgomp.exp
> @@ -241,6 +241,12 @@ proc libgomp_init { args } {
>      if { $offload_additional_options != "" } {
>  	lappend ALWAYS_CFLAGS "additional_flags=${offload_additional_options}"
>      }
> +
> +    # Tell warning from error diagnostics.  This fits for C, C++, and Fortran.
> +    global gcc_warning_prefix
> +    set gcc_warning_prefix "\[Ww\]arning:"
> +    global gcc_error_prefix
> +    set gcc_error_prefix "(\[Ff\]atal )?\[Ee\]rror:"
>  }
>  
>  #
> -- 
> 2.17.1
> 


	Jakub



More information about the Gcc-patches mailing list