[committed] rs6000: Fix test_mffsl.c effective target check

Message ID 7dd2d61c-7f29-6d03-2f61-35eed745bc0a@linux.ibm.com
State Committed
Commit e6a6569ce28958ae768acc1c2f6cc38643b55438
Headers
Series [committed] rs6000: Fix test_mffsl.c effective target check |

Commit Message

Li, Pan2 via Gcc-patches Nov. 23, 2021, 7:14 p.m. UTC
  Hi!

Paul Clarke pointed out to me that I had wrongly used a compile-time check
instead of a run-time check in this executable test.  This patch fixes
that.  I also fixed a typo in a string that caught my eye.

Tested on powerpc64le-linux-gnu, committed as obvious.

Thanks!
Bill


2021-11-23  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/testsuite/
	* gcc.target/powerpc/test_mffsl.c: Change effective target to
	a run-time check.  Fix a typo in a debug print statement.
---
 gcc/testsuite/gcc.target/powerpc/test_mffsl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Segher Boessenkool Nov. 26, 2021, 5:46 p.m. UTC | #1
Hi!

On Tue, Nov 23, 2021 at 01:14:05PM -0600, Bill Schmidt wrote:
> Paul Clarke pointed out to me that I had wrongly used a compile-time check
> instead of a run-time check in this executable test.  This patch fixes
> that.  I also fixed a typo in a string that caught my eye.
> 
> Tested on powerpc64le-linux-gnu, committed as obvious.

Thanks.

> --- a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
> +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
> @@ -1,6 +1,6 @@
>  /* { dg-do run { target { powerpc*-*-* } } } */

(The target clause is redundant fwiw, feel free to remove it).

>  /* { dg-options "-O2 -std=c99 -mcpu=power9" } */
> -/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-require-effective-target p9vector_hw } */

This selector doesn't make too much sense, since nothing in here
requires vectors at all.  p9modulo_hw makes more sense.  Except the
name of that should just be power9_hw :-)

The OS can disallow vector insns (MSR[VEC] and/or MSR[VSX]), so
p9vector_hw tests it isn't doing that, and that the hardware is a p9.
p9modulo_hw does only the latter, and we have no reason to check
separately if we can run modulo insns anyway :-)

So please change the test here.  And bonus points if you can rename
p9modulo_hw and _ok (in a separate patch of course).


Segher
  

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
index 28c2b91988e..f1f960c51c7 100644
--- a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
+++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
@@ -1,6 +1,6 @@ 
 /* { dg-do run { target { powerpc*-*-* } } } */
 /* { dg-options "-O2 -std=c99 -mcpu=power9" } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target p9vector_hw } */
 
 #ifdef DEBUG
 #include <stdio.h>
@@ -28,7 +28,7 @@  int main ()
   if (mffs_val.ll != mffsl_val.ll)
     {
 #ifdef DEBUG
-      printf("ERROR, __builtin_mffsl() returned 0x%llx, not the expecected value 0x%llx\n",
+      printf("ERROR, __builtin_mffsl() returned 0x%llx, not the expected value 0x%llx\n",
 	     mffsl_val.ll, mffs_val.ll);
 #else
       abort();