[committed] rs6000/test: Make ppc-fortran.exp only available for PowerPC target

Message ID 8cfd3eeb-9e68-9fcf-631b-18f2971fd85d@linux.ibm.com
State Accepted
Headers
Series [committed] rs6000/test: Make ppc-fortran.exp only available for PowerPC target |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Kewen.Lin Jan. 11, 2023, 1:09 p.m. UTC
  Hi,

When testing one patch which adds a fortran test case into
test bucket powerpc/ppc-fortran/, I found one unexpected
failure on a non-PowerPC target.  It's due to that
ppc-fortran.exp does not exit early if the testing target
isn't a PowerPC target.  This patch is to make it exit
immediately if the testing target isn't a PowerPC target.

Tested on x86_64-redhat-linux and powerpc64{,le}-linux-gnu.

Committed in r13-5108-gde99049f6fe534.

BR,
Kewen
-----
gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: Exit immediately if
	the testing target isn't a PowerPC target.
---
 gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp | 5 +++++
 1 file changed, 5 insertions(+)

--
2.34.1
  

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
index bd7ad95ad0d..ded643b56bf 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
@@ -16,6 +16,11 @@ 

 # GCC testsuite that uses the `dg.exp' driver.

+# Exit immediately if this isn't a PowerPC target.
+if { ![istarget powerpc*-*-*] && ![istarget rs6000-*-*] } then {
+  return
+}
+
 # Load support procs.
 load_lib gfortran-dg.exp