]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix pr101145inf*.c testcases [PR117494]
authorAndrew Pinski <quic_apinski@quicinc.com>
Sun, 17 Nov 2024 21:40:22 +0000 (13:40 -0800)
committerAndrew Pinski <quic_apinski@quicinc.com>
Mon, 18 Nov 2024 07:44:41 +0000 (23:44 -0800)
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.

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_apinski@quicinc.com>
gcc/testsuite/gcc.dg/vect/pr101145inf.c
gcc/testsuite/gcc.dg/vect/pr101145inf.inc
gcc/testsuite/gcc.dg/vect/pr101145inf_1.c

index 3ad8c1a2dd7b0e061ce2becc32925b574bfab292..aa598875aa599585506f9845dbddcaaf7b7cd868 100644 (file)
@@ -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"
index 4aa3d0491878ff0a96e7e08d695b9a294c6e01ea..eb855b9881ab9db24f24341d52ca508bdb63b6a3 100644 (file)
@@ -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();
+}
index e3e9dd46d10a0ca0c3a02e75590c93a2ee63b320..0465788c3ccaf2ee7deef3f088e34a6b47bc1cb9 100644 (file)
@@ -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"