Hi Andrew,

On Sun, 17 Nov 2024 at 22:49, Andrew Pinski <quic_apin...@quicinc.com> wrote:
>
> Instead of doing a dg-run with a specific target check for linux.
> Use signal as the effective-target since this requires the use
> of ALARM signal to do the testing.
> Also use check_vect in the main and renames main to main1 to make sure
> we don't use the registers.
>
> Tested on x86_64-linux-gnu.

Can you explain the context of this change? Are you testing on a
target which matches *-*-linux* *-*-gnu* *-*-uclinux* but does not
support 'alarm'?

I was looking at backporting this and a later patch from Torbjorn to
gcc-14, but I noticed that the default dg-do-what in this directory is
'compile' and the previous
dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* }  changed it to
'run' on linux targets (thus on linux we had 2 PASS, one for
compilation, one for execution).
And the test was skipped on non-linux targets.

After your patch, the test became compile-only on linux, was this intentional?

Maybe we should use instead:
/* { dg-do run } */ (without target selector)
/* { dg-require-effective-target signal } */
not tested, but I think this would restore the previous behaviour on
*linux* targets, but skip the test on targets which do not support
alarm.

Am I missing something?
I can send a patch to do this.

Thanks,

Christophe


>
>         PR testsuite/117494
> gcc/testsuite/ChangeLog:
>
>         * gcc.dg/vect/pr101145inf.c: Remove dg-do and replace
>         with dg-require-effective-target of signal.
>         * gcc.dg/vect/pr101145inf_1.c: Likewise.
>         * gcc.dg/vect/pr101145inf.inc: Rename main to main1
>         and mark as noinline.
>         Include tree-vect.h. Have main call check_vect and main1.
>
> Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
> ---
>  gcc/testsuite/gcc.dg/vect/pr101145inf.c   | 2 +-
>  gcc/testsuite/gcc.dg/vect/pr101145inf.inc | 9 ++++++++-
>  gcc/testsuite/gcc.dg/vect/pr101145inf_1.c | 2 +-
>  3 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.dg/vect/pr101145inf.c 
> b/gcc/testsuite/gcc.dg/vect/pr101145inf.c
> index 3ad8c1a2dd7..aa598875aa5 100644
> --- a/gcc/testsuite/gcc.dg/vect/pr101145inf.c
> +++ b/gcc/testsuite/gcc.dg/vect/pr101145inf.c
> @@ -1,4 +1,4 @@
> -/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */
> +/* { dg-require-effective-target signal } */
>  /* { dg-additional-options "-O3" } */
>  #include <limits.h>
>  #include "pr101145inf.inc"
> diff --git a/gcc/testsuite/gcc.dg/vect/pr101145inf.inc 
> b/gcc/testsuite/gcc.dg/vect/pr101145inf.inc
> index 4aa3d049187..eb855b9881a 100644
> --- a/gcc/testsuite/gcc.dg/vect/pr101145inf.inc
> +++ b/gcc/testsuite/gcc.dg/vect/pr101145inf.inc
> @@ -1,6 +1,7 @@
>  #include <unistd.h>
>  #include <signal.h>
>  #include <stdlib.h>
> +#include "tree-vect.h"
>
>  void test_finite ();
>  void test_infinite ();
> @@ -10,7 +11,8 @@ void do_exit (int i)
>    exit (0);
>  }
>
> -int main(void)
> +__attribute__((noinline))
> +int main1(void)
>  {
>    test_finite ();
>    struct sigaction s;
> @@ -26,3 +28,8 @@ int main(void)
>    return 1;
>  }
>
> +int main(void)
> +{
> +  check_vect ();
> +  return main1();
> +}
> diff --git a/gcc/testsuite/gcc.dg/vect/pr101145inf_1.c 
> b/gcc/testsuite/gcc.dg/vect/pr101145inf_1.c
> index e3e9dd46d10..0465788c3cc 100644
> --- a/gcc/testsuite/gcc.dg/vect/pr101145inf_1.c
> +++ b/gcc/testsuite/gcc.dg/vect/pr101145inf_1.c
> @@ -1,4 +1,4 @@
> -/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */
> +/* { dg-require-effective-target signal } */
>  /* { dg-additional-options "-O3" } */
>  #include <limits.h>
>  #include "pr101145inf.inc"
> --
> 2.43.0
>

Reply via email to