On Fri, Mar 21, 2025 at 01:10:44PM +0100, Tobias Burnus wrote:
> I tried to match in dg-warning the whole string, including [-OpenMP], but it 
> failed.
> 
> I turned out that that was because of -fdiagnostics-urls ...
> 
> Solution do what other testsuites do: Use -fdiagnostics-plain-output.
> 
> Unless there are further comments, I intent to commit the attached patch 
> later today.
> 
> Thanks,
> 
> Tobias

> testsuite/lib/libgomp.exp: compile with -fdiagnostics-plain-output
> 
> libgomp.exp added -fno-diagnostics-show-caret and -fdiagnostics-color=never
> as 'additional_flags' for compilation. However, it turned out that this now
> is insufficient as the [...] part of diagnostics have a hyperlink URL.
> 
> Solution: Use the -fdiagnostics-plain-output flag instead, added in commit
> r11-2701-g129a1319c0ab73. This flag currently implies the following flags:
>    -fno-diagnostics-show-caret
>    -fno-diagnostics-show-line-numbers
>    -fdiagnostics-color=never
>    -fdiagnostics-urls=never
>    -fdiagnostics-path-format=separate-events
>    -fdiagnostics-text-art-charset=none
>    -fno-diagnostics-show-event-links
> 
> libgomp/ChangeLog:
> 
>       * testsuite/lib/libgomp.exp (libgomp_init): Add
>       -fdiagnostics-plain-output to additional_flags; remove
>       -fno-diagnostics-show-caret and -fdiagnostics-color=never.

LGTM.
Though, generally tests with dg-warning/dg-error/dg-message should generally
go into gcc/testsuite/*/gomp/ rather than libgomp if possible.

> --- a/libgomp/testsuite/lib/libgomp.exp
> +++ b/libgomp/testsuite/lib/libgomp.exp
> @@ -233,11 +233,8 @@ proc libgomp_init { args } {
>      # error-message parsing machinery.
>      lappend ALWAYS_CFLAGS "additional_flags=-fmessage-length=0"
>  
> -    # Disable caret
> -    lappend ALWAYS_CFLAGS "additional_flags=-fno-diagnostics-show-caret"
> -
> -    # Disable color diagnostics
> -    lappend ALWAYS_CFLAGS "additional_flags=-fdiagnostics-color=never"
> +    # Disable caret, color, URL diagnostics
> +    lappend ALWAYS_CFLAGS "additional_flags=-fdiagnostics-plain-output"
>  
>      # Help GCC to find offload compilers' 'mkoffload'.
>      global offload_additional_options


        Jakub

Reply via email to