diff mbox series

test/rs6000: Replace test target p8 and p9+

Message ID 9e382171-f07b-7004-db3b-e8261bddac34@linux.ibm.com
State New
Headers show
Series test/rs6000: Replace test target p8 and p9+ | expand

Commit Message

Kewen.Lin Sept. 1, 2020, 3:19 a.m. UTC
Hi,

This is a trivial patch to clean existing rs6000 test targets
p8 and p9+ with existing has_arch_pwr8 and has_arch_pwr9
target combination or only one of them.  Not sure if it's a
good idea to tidy this, but send out for comments.

Bootstrapped/regtested on powerpc64le-linux-gnu P9.

Any comments are highly appreciated.

BR,
Kewen
-----

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/pr92398.p9+.c: Replace p9+ with has_arch_pwr9.
	* gcc.target/powerpc/pr92398.p9-.c: Replace p9+ with has_arch_pwr9,
	and replace p8 with has_arch_pwr8 && !has_arch_pwr9.
	* lib/target-supports.exp (check_effective_target_p8): Remove.
	(check_effective_target_p9+): Remove.

Comments

Segher Boessenkool Sept. 3, 2020, 11:35 a.m. UTC | #1
Hi!

On Tue, Sep 01, 2020 at 11:19:55AM +0800, Kewen.Lin wrote:
> This is a trivial patch to clean existing rs6000 test targets
> p8 and p9+ with existing has_arch_pwr8 and has_arch_pwr9
> target combination or only one of them.  Not sure if it's a
> good idea to tidy this, but send out for comments.

The has_arch_xxx is a lot easier to understand.  The "p9+" thing would
become especially un-nice if there was an actual processor called
"Power9+" (there were for p4, p5, p7 at least, so it is a practical
concern).

> 	* gcc.target/powerpc/pr92398.p9+.c: Replace p9+ with has_arch_pwr9.
> 	* gcc.target/powerpc/pr92398.p9-.c: Replace p9+ with has_arch_pwr9,
> 	and replace p8 with has_arch_pwr8 && !has_arch_pwr9.
> 	* lib/target-supports.exp (check_effective_target_p8): Remove.
> 	(check_effective_target_p9+): Remove.

> +/* { dg-final { scan-assembler-times {\mstd\M} 2 { xfail { { {! has_arch_pwr9} && has_arch_pwr8 } && be } } } } */

Not sure you need all braces here.  But this isn't pure tcl, some of it
is parsed by routines in dejagnu (which allow much less), so who knows.

Okay for trunk.  Thanks!


Segher
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/pr92398.p9+.c b/gcc/testsuite/gcc.target/powerpc/pr92398.p9+.c
index a819c3f16af..72dd1d9a274 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr92398.p9+.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr92398.p9+.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile { target { lp64 && p9+ } } } */
+/* { dg-do compile { target { lp64 && has_arch_pwr9 } } } */
 /* { dg-require-effective-target powerpc_vsx_ok } */
 /* { dg-options "-O2 -mvsx" } */
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr92398.p9-.c b/gcc/testsuite/gcc.target/powerpc/pr92398.p9-.c
index 065ae73f267..bd7fa98af51 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr92398.p9-.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr92398.p9-.c
@@ -1,9 +1,9 @@ 
-/* { dg-do compile { target { lp64 && {! p9+} } } } */
+/* { dg-do compile { target { lp64 && {! has_arch_pwr9} } } } */
 /* { dg-require-effective-target powerpc_vsx_ok } */
 /* { dg-options "-O2 -mvsx" } */
 
 /* { dg-final { scan-assembler-times {\mnot\M} 2 { xfail be } } } */
-/* { dg-final { scan-assembler-times {\mstd\M} 2 { xfail { p8 && be } } } } */
+/* { dg-final { scan-assembler-times {\mstd\M} 2 { xfail { { {! has_arch_pwr9} && has_arch_pwr8 } && be } } } } */
 
 /* Source code for the test in pr92398.h */
 #include "pr92398.h"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index de2196d71f7..220e858f63b 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2687,26 +2687,6 @@  proc check_effective_target_le { } {
     }]
 }
 
-# Return 1 if we're generating code for only power8 platforms.
-
-proc check_effective_target_p8 {  } {
-  return [check_no_compiler_messages_nocache p8 assembly {
-	#if !(!defined(_ARCH_PWR9) && defined(_ARCH_PWR8))
-	#error NO
-	#endif
-  } ""]
-}
-
-# Return 1 if we're generating code for power9 or later platforms.
-
-proc check_effective_target_p9+ {  } {
-  return [check_no_compiler_messages_nocache p9+ assembly {
-	#if !(defined(_ARCH_PWR9))
-	#error NO
-	#endif
-  } ""]
-}
-
 # Return 1 if we're generating 32-bit code using default options, 0
 # otherwise.