public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000/test: Fix bswap64-4.c with has_arch_ppc64 [PR106680]
@ 2022-08-31  9:33 Kewen.Lin
  2022-08-31 14:13 ` Peter Bergner
  2022-08-31 15:24 ` Segher Boessenkool
  0 siblings, 2 replies; 22+ messages in thread
From: Kewen.Lin @ 2022-08-31  9:33 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, David Edelsohn, Peter Bergner

Hi,

Test case bswap64-4.c suffers the issue as its comments:

/* On some versions of dejagnu this test will fail when
   biarch testing with RUNTESTFLAGS="--target_board=unix
   '{-m64,-m32}'" due to -m32 being added on the command
   line after the dg-options -mpowerpc64.
   common/config/rs6000/rs6000-common.c:
   rs6000_handle_option disables -mpowerpc64 for -m32.  */

As tested, on test machine with dejaGnu 1.6.2, the compilation
option order looks like: -m32 ... -mpowerpc64, option
-mpowerpc64 still takes effect;  While on test machine with
dejaGnu 1.5.1, the option order looks like: -mpowerpc64 ... -m32,
option -mpowerpc64 is disabled by -m32, then the case fails.

This fix leverages the new effective target has_arch_ppc64 and
places dg-options before dg-require-effective-target (it makes
dg-options to be used for has_arch_ppc64 checking), on machine
with dejaGnu 1.6.2, the checking succeeds and the case passes;
while on machine with dejaGnu 1.5.1, the checking fails then
the case is marked as unsupported.

Tested on powerpc64-linux-gnu P7 and P8,
and powerpc64le-linux-gnu P9 and P10.

I'll push this soon if no objections.

BR,
Kewen
-----
	PR testsuite/106680

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/bswap64-4.c: Adjust with has_arch_ppc64.
---
 gcc/testsuite/gcc.target/powerpc/bswap64-4.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/bswap64-4.c b/gcc/testsuite/gcc.target/powerpc/bswap64-4.c
index 5acbb91ee38..85a7bbbd367 100644
--- a/gcc/testsuite/gcc.target/powerpc/bswap64-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/bswap64-4.c
@@ -1,7 +1,8 @@
 /* { dg-do compile { target { powerpc*-*-* } } } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
-/* { dg-options "-O2 -mpowerpc64" } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -mpowerpc64" } */
+/* { dg-require-effective-target has_arch_ppc64 } */
 /* { dg-final { scan-assembler-times "lwbrx" 2 { target { ! has_arch_pwr7 } } } } */
 /* { dg-final { scan-assembler-times "stwbrx" 2 { target { ! has_arch_pwr7 } } } } */
 /* { dg-final { scan-assembler-times "ldbrx" 1 { target has_arch_pwr7 } } } */
--
2.27.0

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-09-05  2:35 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31  9:33 [PATCH] rs6000/test: Fix bswap64-4.c with has_arch_ppc64 [PR106680] Kewen.Lin
2022-08-31 14:13 ` Peter Bergner
2022-09-01  8:57   ` Kewen.Lin
2022-09-01 14:57     ` Segher Boessenkool
2022-09-02  0:50       ` Kewen.Lin
2022-09-02 17:36         ` Segher Boessenkool
2022-09-05  2:25           ` Kewen.Lin
2022-08-31 15:24 ` Segher Boessenkool
2022-08-31 15:48   ` Peter Bergner
2022-08-31 16:05     ` Segher Boessenkool
2022-08-31 17:00       ` Peter Bergner
2022-08-31 19:28         ` Segher Boessenkool
2022-08-31 19:53           ` Peter Bergner
2022-08-31 21:07             ` Segher Boessenkool
2022-08-31 21:38               ` Peter Bergner
2022-08-31 21:49                 ` Segher Boessenkool
2022-08-31 22:17                   ` Peter Bergner
2022-09-01  9:05   ` Kewen.Lin
2022-09-01 15:04     ` Segher Boessenkool
2022-09-02  0:51       ` Kewen.Lin
2022-09-02 17:44         ` Segher Boessenkool
2022-09-05  2:35           ` Kewen.Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).