diff mbox series

[RS6000] Don't be too clever with dg-do run and dg-do compile

Message ID 20201028105056.GZ15956@bubble.grove.modra.org
State New
Headers show
Series [RS6000] Don't be too clever with dg-do run and dg-do compile | expand

Commit Message

Alan Modra Oct. 28, 2020, 10:50 a.m. UTC
Otherwise some versions of dejagnu go ahead and run the vsx tests
below when they should not.  To best cope with older dejagnu, put
"run" before "compile", the idea being that if the second dg-do always
wins then that won't cause fails.

The altivec tests also need -save-temps for the scan-assembler test to
occur when vms_hw.

Regression tested powerpc64le-linux and powerpc64-linux.  OK?

	* gcc.target/powerpc/vsx-load-element-extend-char.c: Put "dg-do run"
	before "dg-do compile", and make them mutually exclusive.
	* gcc.target/powerpc/vsx-load-element-extend-int.c: Likewise.
	* gcc.target/powerpc/vsx-load-element-extend-longlong.c: Likewise.
	* gcc.target/powerpc/vsx-load-element-extend-short.c: Likewise.
	* gcc.target/powerpc/vsx-store-element-truncate-char.c: Likewise.
	* gcc.target/powerpc/vsx-store-element-truncate-int.c: Likewise.
	* gcc.target/powerpc/vsx-store-element-truncate-longlong.c: Likewise.
	* gcc.target/powerpc/vsx-store-element-truncate-short.c: Likewise.
	* gcc.target/powerpc/altivec-consts.c: Likewise, add -save-temps.
	* gcc.target/powerpc/le-altivec-consts.c: Likewise.

Comments

will schmidt Oct. 28, 2020, 3:05 p.m. UTC | #1
On Wed, 2020-10-28 at 21:20 +1030, Alan Modra via Gcc-patches wrote:
> Otherwise some versions of dejagnu go ahead and run the vsx tests
> below when they should not.  To best cope with older dejagnu, put
> "run" before "compile", the idea being that if the second dg-do always
> wins then that won't cause fails.
> 
> The altivec tests also need -save-temps for the scan-assembler test to
> occur when vms_hw.

vmx_hw ? :)

> 
> Regression tested powerpc64le-linux and powerpc64-linux.  OK?
> 
> 	* gcc.target/powerpc/vsx-load-element-extend-char.c: Put "dg-do run"
> 	before "dg-do compile", and make them mutually exclusive.
> 	* gcc.target/powerpc/vsx-load-element-extend-int.c: Likewise.
> 	* gcc.target/powerpc/vsx-load-element-extend-longlong.c: Likewise.
> 	* gcc.target/powerpc/vsx-load-element-extend-short.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-char.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-int.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-longlong.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-short.c: Likewise.
> 	* gcc.target/powerpc/altivec-consts.c: Likewise, add -save-temps.
> 	* gcc.target/powerpc/le-altivec-consts.c: Likewise.
> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-consts.c b/gcc/testsuite/gcc.target/powerpc/altivec-consts.c
> index d59f9b4cf1c..c68c68125d1 100644
> --- a/gcc/testsuite/gcc.target/powerpc/altivec-consts.c
> +++ b/gcc/testsuite/gcc.target/powerpc/altivec-consts.c
> @@ -1,7 +1,7 @@
>  /* { dg-do run { target vmx_hw } } */
> -/* { dg-do compile } */
> +/* { dg-do compile { target { ! vmx_hw } } } */
>  /* { dg-require-effective-target powerpc_altivec_ok } */
> -/* { dg-options "-maltivec -mabi=altivec -O2" } */
> +/* { dg-options "-maltivec -mabi=altivec -O2 -save-temps" } */
> 
>  /* Check that "easy" AltiVec constants are correctly synthesized.  */
> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c b/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c
> index f48ef44e676..a1db5e92f87 100644
> --- a/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c
> +++ b/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c
> @@ -1,7 +1,7 @@
>  /* { dg-do run { target vmx_hw } } */
> -/* { dg-do compile } */
> +/* { dg-do compile { target { ! vmx_hw } } } */
>  /* { dg-require-effective-target powerpc_altivec_ok } */
> -/* { dg-options "-maltivec -mabi=altivec -O2" } */
> +/* { dg-options "-maltivec -mabi=altivec -O2 -save-temps" } */
> 
>  /* Check that "easy" AltiVec constants are correctly synthesized.  */
> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c
> index f386346e059..c23a9128680 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c
> @@ -2,8 +2,9 @@
>     Test of vec_xl_sext and vec_xl_zext (load into rightmost
>     vector element and zero/sign extend). */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
>  /* { dg-options "-mdejagnu-cpu=power10 -O3 -save-temps" } */


Ok.   These are from some tests I recently committed,   I obviously
missed this combo (testing with older dejagnu).. I think I've updated
my dejagnu versions all over the place for other reasons.  Do you
consider this a non-typical corner case with older dejagnu, or should I
try to explicitly check for this in the future?

Similar/same changes below.  These changes all seem reasonable.

lgtm, 
thanks
-Will



> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c
> index ea737466a58..c40e1a3a0f7 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c
> @@ -2,8 +2,9 @@
>     Test of vec_xl_sext and vec_xl_zext (load into rightmost
>     vector element and zero/sign extend). */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
> 
>  /* Deliberately set optization to zero for this test to confirm
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c
> index cd155c2013d..405b4245f8e 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c
> @@ -2,8 +2,9 @@
>     Test of vec_xl_sext and vec_xl_zext (load into rightmost
>     vector element and zero/sign extend). */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
>  /* { dg-options "-mdejagnu-cpu=power10 -O3 -save-temps" } */
> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c
> index 68fdcdcea37..837ba79c9ab 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c
> @@ -2,8 +2,9 @@
>     Test of vec_xl_sext and vec_xl_zext (load into rightmost
>     vector element and zero/sign extend). */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
> 
>  /* Deliberately set optization to zero for this test to confirm
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c
> index 45c49547d66..3049b1c2c28 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c
> @@ -1,8 +1,9 @@
>  /*
>     Test of vec_xst_trunc (truncate and store rightmost vector element) */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
>  /* Deliberately set optization to zero for this test to confirm
>     the stxvr*x instruction is generated. At higher optimization levels
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c
> index f263e3d5cc9..7cc7699f8eb 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c
> @@ -1,8 +1,9 @@
>  /*
>     Test of vec_xst_trunc (truncate and store rightmost vector element) */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
>  /* Deliberately set optization to zero for this test to confirm
>     the stxvr*x instruction is generated. At higher optimization levels
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c
> index 0eeef5e6ba9..e1bd0216611 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c
> @@ -1,8 +1,9 @@
>  /*
>     Test of vec_xst_trunc (truncate and store rightmost vector element) */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
> 
>  /* Deliberately set optization to zero for this test to confirm
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c
> index 0186ddc552f..b173b36dbda 100644
> --- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c
> @@ -1,8 +1,9 @@
>  /*
>     Test of vec_xst_trunc (truncate and store rightmost vector element) */
> 
> -/* { dg-do compile {target power10_ok} } */
> -/* { dg-do run {target power10_hw} } */
> +/* { dg-do run { target power10_hw } } */
> +/* { dg-do compile { target { ! power10_hw } } } */
> +/* { dg-require-effective-target power10_ok } */
>  /* { dg-require-effective-target int128 } */
> 
>  /* Deliberately set optization to zero for this test to confirm
>
Segher Boessenkool Oct. 28, 2020, 5:12 p.m. UTC | #2
On Wed, Oct 28, 2020 at 10:05:14AM -0500, will schmidt wrote:
> On Wed, 2020-10-28 at 21:20 +1030, Alan Modra via Gcc-patches wrote:
> > Otherwise some versions of dejagnu go ahead and run the vsx tests
> > below when they should not.  To best cope with older dejagnu, put
> > "run" before "compile", the idea being that if the second dg-do always
> > wins then that won't cause fails.
> > 
> > The altivec tests also need -save-temps for the scan-assembler test to
> > occur when vms_hw.
> 
> vmx_hw ? :)

For vms_hw it needs a lot more ;-)

> Ok.   These are from some tests I recently committed,   I obviously
> missed this combo (testing with older dejagnu).. I think I've updated
> my dejagnu versions all over the place for other reasons.  Do you
> consider this a non-typical corner case with older dejagnu, or should I
> try to explicitly check for this in the future?

I don't know what version of dejagnu introduced the fix, but probably
newer than our minimum required version.

Thanks,


Segher
Segher Boessenkool Oct. 28, 2020, 5:16 p.m. UTC | #3
On Wed, Oct 28, 2020 at 09:20:56PM +1030, Alan Modra wrote:
> Otherwise some versions of dejagnu go ahead and run the vsx tests
> below when they should not.  To best cope with older dejagnu, put
> "run" before "compile", the idea being that if the second dg-do always
> wins then that won't cause fails.

If they are mutually exclusive, does the order still matter?  (Just FMI.)

> The altivec tests also need -save-temps for the scan-assembler test to
> occur when vms_hw.

> Regression tested powerpc64le-linux and powerpc64-linux.  OK?
> 
> 	* gcc.target/powerpc/vsx-load-element-extend-char.c: Put "dg-do run"
> 	before "dg-do compile", and make them mutually exclusive.
> 	* gcc.target/powerpc/vsx-load-element-extend-int.c: Likewise.
> 	* gcc.target/powerpc/vsx-load-element-extend-longlong.c: Likewise.
> 	* gcc.target/powerpc/vsx-load-element-extend-short.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-char.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-int.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-longlong.c: Likewise.
> 	* gcc.target/powerpc/vsx-store-element-truncate-short.c: Likewise.
> 	* gcc.target/powerpc/altivec-consts.c: Likewise, add -save-temps.
> 	* gcc.target/powerpc/le-altivec-consts.c: Likewise.

Okay for trunk.  Thanks!


Segher
Alan Modra Oct. 28, 2020, 10:39 p.m. UTC | #4
On Wed, Oct 28, 2020 at 12:16:00PM -0500, Segher Boessenkool wrote:
> On Wed, Oct 28, 2020 at 09:20:56PM +1030, Alan Modra wrote:
> > Otherwise some versions of dejagnu go ahead and run the vsx tests
> > below when they should not.  To best cope with older dejagnu, put
> > "run" before "compile", the idea being that if the second dg-do always
> > wins then that won't cause fails.
> 
> If they are mutually exclusive, does the order still matter?  (Just FMI.)

Yes, it does.  Older dejagnu takes the last action regardless of the
target selector success.  Newer dejagnu uses the last action of a line
with a successful target selector.

commit 569f8718b534a2cd9511a7d640352eb0126ff492
Author: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date:   Mon Mar 28 17:31:07 2016 +1100

            * dg.exp (dg-do): Do not change the previously selected action if
            a de-selected dg-do is encountered.
    
    Signed-off-by: Ben Elliston <bje@gnu.org>
Segher Boessenkool Oct. 29, 2020, 8:40 p.m. UTC | #5
On Thu, Oct 29, 2020 at 09:09:13AM +1030, Alan Modra wrote:
> On Wed, Oct 28, 2020 at 12:16:00PM -0500, Segher Boessenkool wrote:
> > On Wed, Oct 28, 2020 at 09:20:56PM +1030, Alan Modra wrote:
> > > Otherwise some versions of dejagnu go ahead and run the vsx tests
> > > below when they should not.  To best cope with older dejagnu, put
> > > "run" before "compile", the idea being that if the second dg-do always
> > > wins then that won't cause fails.
> > 
> > If they are mutually exclusive, does the order still matter?  (Just FMI.)
> 
> Yes, it does.  Older dejagnu takes the last action regardless of the
> target selector success.  Newer dejagnu uses the last action of a line
> with a successful target selector.
> 
> commit 569f8718b534a2cd9511a7d640352eb0126ff492
> Author: Dominik Vogt <vogt@linux.vnet.ibm.com>
> Date:   Mon Mar 28 17:31:07 2016 +1100
> 
>             * dg.exp (dg-do): Do not change the previously selected action if
>             a de-selected dg-do is encountered.
>     
>     Signed-off-by: Ben Elliston <bje@gnu.org>

So fixed in 1.6 and later.  Thanks!


Segher
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-consts.c b/gcc/testsuite/gcc.target/powerpc/altivec-consts.c
index d59f9b4cf1c..c68c68125d1 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-consts.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-consts.c
@@ -1,7 +1,7 @@ 
 /* { dg-do run { target vmx_hw } } */
-/* { dg-do compile } */
+/* { dg-do compile { target { ! vmx_hw } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec -mabi=altivec -O2" } */
+/* { dg-options "-maltivec -mabi=altivec -O2 -save-temps" } */
 
 /* Check that "easy" AltiVec constants are correctly synthesized.  */
 
diff --git a/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c b/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c
index f48ef44e676..a1db5e92f87 100644
--- a/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c
+++ b/gcc/testsuite/gcc.target/powerpc/le-altivec-consts.c
@@ -1,7 +1,7 @@ 
 /* { dg-do run { target vmx_hw } } */
-/* { dg-do compile } */
+/* { dg-do compile { target { ! vmx_hw } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec -mabi=altivec -O2" } */
+/* { dg-options "-maltivec -mabi=altivec -O2 -save-temps" } */
 
 /* Check that "easy" AltiVec constants are correctly synthesized.  */
 
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c
index f386346e059..c23a9128680 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-char.c
@@ -2,8 +2,9 @@ 
    Test of vec_xl_sext and vec_xl_zext (load into rightmost
    vector element and zero/sign extend). */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 /* { dg-options "-mdejagnu-cpu=power10 -O3 -save-temps" } */
 
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c
index ea737466a58..c40e1a3a0f7 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-int.c
@@ -2,8 +2,9 @@ 
    Test of vec_xl_sext and vec_xl_zext (load into rightmost
    vector element and zero/sign extend). */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 
 /* Deliberately set optization to zero for this test to confirm
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c
index cd155c2013d..405b4245f8e 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-longlong.c
@@ -2,8 +2,9 @@ 
    Test of vec_xl_sext and vec_xl_zext (load into rightmost
    vector element and zero/sign extend). */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 /* { dg-options "-mdejagnu-cpu=power10 -O3 -save-temps" } */
 
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c
index 68fdcdcea37..837ba79c9ab 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend-short.c
@@ -2,8 +2,9 @@ 
    Test of vec_xl_sext and vec_xl_zext (load into rightmost
    vector element and zero/sign extend). */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 
 /* Deliberately set optization to zero for this test to confirm
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c
index 45c49547d66..3049b1c2c28 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-char.c
@@ -1,8 +1,9 @@ 
 /*
    Test of vec_xst_trunc (truncate and store rightmost vector element) */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 /* Deliberately set optization to zero for this test to confirm
    the stxvr*x instruction is generated. At higher optimization levels
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c
index f263e3d5cc9..7cc7699f8eb 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-int.c
@@ -1,8 +1,9 @@ 
 /*
    Test of vec_xst_trunc (truncate and store rightmost vector element) */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 /* Deliberately set optization to zero for this test to confirm
    the stxvr*x instruction is generated. At higher optimization levels
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c
index 0eeef5e6ba9..e1bd0216611 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-longlong.c
@@ -1,8 +1,9 @@ 
 /*
    Test of vec_xst_trunc (truncate and store rightmost vector element) */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 
 /* Deliberately set optization to zero for this test to confirm
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c
index 0186ddc552f..b173b36dbda 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-store-element-truncate-short.c
@@ -1,8 +1,9 @@ 
 /*
    Test of vec_xst_trunc (truncate and store rightmost vector element) */
 
-/* { dg-do compile {target power10_ok} } */
-/* { dg-do run {target power10_hw} } */
+/* { dg-do run { target power10_hw } } */
+/* { dg-do compile { target { ! power10_hw } } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-require-effective-target int128 } */
 
 /* Deliberately set optization to zero for this test to confirm