On 27/12/2024 08:32, Torbjörn SVENSSON wrote:
> Ok for trunk?
> 
> --
> 
> The implementation of the functions in the test case expects there to be
> a few arguments to the helper functions, but the prototype does not have
> any arguments at all. Align these to avoid these errors:
> 
> .../pr59858.c: In function 're_search_internal':
> .../pr59858.c:95:17: error: too many arguments to function 'check_matching'
> .../pr59858.c:75:12: note: declared here
> .../pr59858.c: At top level:
> .../pr59858.c:100:1: error: conflicting types for 'check_matching'; have 
> 'int(re_match_context_t *, int *)'
> .../pr59858.c:75:12: note: previous declaration of 'check_matching' with type 
> 'int(void)'
> .../pr59858.c: In function 'check_matching':
> .../pr59858.c:106:14: error: too many arguments to function 'transit_state'
> .../pr59858.c:77:23: note: declared here
> .../pr59858.c: At top level:
> .../pr59858.c:111:1: error: conflicting types for 'transit_state'; have 
> 're_dfastate_t *(re_match_context_t *, re_dfastate_t *)'
> .../pr59858.c:77:23: note: previous declaration of 'transit_state' with type 
> 're_dfastate_t *(void)'
> .../pr59858.c: In function 'transit_state':
> .../pr59858.c:116:7: error: too many arguments to function 'build_trtable'
> .../pr59858.c:79:12: note: declared here
> .../pr59858.c: At top level:
> .../pr59858.c:121:1: error: conflicting types for 'build_trtable'; have 
> 'int(const re_dfa_t *, re_dfastate_t *)'
> .../pr59858.c:79:12: note: previous declaration of 'build_trtable' with type 
> 'int(void)'
> 
> Also, add -mcpu=unset to the options to ensure that the -mcpu and -march
> options are compatbile.
> 
> gcc/testsuite/ChangeLog:
> 
>       * gcc.target/arm/pr59858.c: Align function prototype and
>       implementation. Added -mcpu=unset to dg-options.
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
> ---
>  gcc/testsuite/gcc.target/arm/pr59858.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c 
> b/gcc/testsuite/gcc.target/arm/pr59858.c
> index 9336edfce27..cd3dc0954f3 100644
> --- a/gcc/testsuite/gcc.target/arm/pr59858.c
> +++ b/gcc/testsuite/gcc.target/arm/pr59858.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb 
> -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts 
> -fPIC -w -fpermissive" } */
> +/* { dg-options "-mcpu=unset -march=armv5te -fno-builtin -mfloat-abi=soft 
> -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize 
> -fno-tree-dominator-opts -fPIC -w -fpermissive" } */
>  /* { dg-require-effective-target fpic } */
>  /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft 
> -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */
>  /* { dg-require-effective-target arm_arch_v5te_thumb_ok } */
> @@ -73,10 +73,16 @@ static void match_ctx_clean (
>   re_match_context_t *
>  );
>  static int check_matching (
> + re_match_context_t *,
> + int *
>  );
>  static re_dfastate_t *transit_state (
> + re_match_context_t *,
> + re_dfastate_t *
>  );
>  static int build_trtable (
> + const re_dfa_t *,
> + re_dfastate_t *
>  );
>  re_search_internal (int eflags
>  )

I agree with Sam, just select -std=c17 rather than changing the body of the 
test.  But I would also cleanup the dg- stuff as well: we should use 

  dg-add-options arm_arch_v5te_thumb

(since we're already testing for that), then you can simplify the other options 
as well:

- remove dg-skip (shouldn't be needed now)
- remove everything handled by the above from dg-options.

R.

Reply via email to