public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [testsuite] [ppc] skip ppc-fortran if fortran is disabled
@ 2023-04-06  6:19 Alexandre Oliva
  2023-04-06  8:32 ` Kewen.Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Oliva @ 2023-04-06  6:19 UTC (permalink / raw)
  To: gcc-patches
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool, Kewen Lin


Skip ppc-fortran.exp if a trivial fortran program cannot be compiled.

Regstrapped on x86_64-linux-gnu and ppc64-linux-gnu.  Also tested on
ppc64-vx7r2 with gcc-12, with the Fortran language disabled.  Ok to
install?


for  gcc/testsuite/ChangeLog

	* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: Test for
	fortran compiler, skip if missing.
---
 .../gcc.target/powerpc/ppc-fortran/ppc-fortran.exp |    9 +++++++++
 1 file changed, 9 insertions(+)

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 f7e99ac848753..d05c27ab589a7 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
@@ -33,6 +33,15 @@ if ![info exists DEFAULT_FFLAGS] then {
 # Initialize `dg'.
 dg-init
 
+if { ![check_no_compiler_messages fortran_available assembly {
+! Fortran
+program P
+  stop
+end program P
+} ""] } {
+    return
+}
+
 global gfortran_test_path
 global gfortran_aux_module_flags
 set gfortran_test_path $srcdir/$subdir

-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

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

* Re: [PATCH] [testsuite] [ppc] skip ppc-fortran if fortran is disabled
  2023-04-06  6:19 [PATCH] [testsuite] [ppc] skip ppc-fortran if fortran is disabled Alexandre Oliva
@ 2023-04-06  8:32 ` Kewen.Lin
  2023-04-07  3:41   ` Alexandre Oliva
  0 siblings, 1 reply; 3+ messages in thread
From: Kewen.Lin @ 2023-04-06  8:32 UTC (permalink / raw)
  To: Alexandre Oliva
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool,
	Kewen Lin, gcc-patches

Hi Alexandre,

on 2023/4/6 14:19, Alexandre Oliva wrote:
> 
> Skip ppc-fortran.exp if a trivial fortran program cannot be compiled.
> 

IIUC, without this patch and under the configuration disabling fortran,
all the cases in this sub-testsuite would fail?  Thanks for fixing!

> Regstrapped on x86_64-linux-gnu and ppc64-linux-gnu.  Also tested on
> ppc64-vx7r2 with gcc-12, with the Fortran language disabled.  Ok to
> install?
> 
> 
> for  gcc/testsuite/ChangeLog
> 
> 	* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: Test for
> 	fortran compiler, skip if missing.
> ---
>  .../gcc.target/powerpc/ppc-fortran/ppc-fortran.exp |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> 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 f7e99ac848753..d05c27ab589a7 100644
> --- a/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
> +++ b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
> @@ -33,6 +33,15 @@ if ![info exists DEFAULT_FFLAGS] then {
>  # Initialize `dg'.
>  dg-init
> 
> +if { ![check_no_compiler_messages fortran_available assembly {
> +! Fortran
> +program P
> +  stop
> +end program P
> +} ""] } {
> +    return
> +}
> +

super nit: this check only needs proc check_no_compiler_messages,
can it be moved a bit upward just after line "load_lib gfortran-dg.exp"
then it can skip more unnecessary codes?

OK with this nit fixed (if you agree).  Thanks!

BR,
Kewen



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

* Re: [PATCH] [testsuite] [ppc] skip ppc-fortran if fortran is disabled
  2023-04-06  8:32 ` Kewen.Lin
@ 2023-04-07  3:41   ` Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2023-04-07  3:41 UTC (permalink / raw)
  To: Kewen.Lin
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool,
	Kewen Lin, gcc-patches

Hello, Kewen,

On Apr  6, 2023, "Kewen.Lin" <linkw@linux.ibm.com> wrote:

> on 2023/4/6 14:19, Alexandre Oliva wrote:

>> Skip ppc-fortran.exp if a trivial fortran program cannot be compiled.

> IIUC, without this patch and under the configuration disabling fortran,
> all the cases in this sub-testsuite would fail?  Thanks for fixing!

Yup

> super nit: this check only needs proc check_no_compiler_messages,
> can it be moved a bit upward just after line "load_lib gfortran-dg.exp"
> then it can skip more unnecessary codes?

I wasn't sure, so I'd put it after supporting code.  Turns out it can.
Here's what I've just finished retesting, and am thus checking in.
Thanks,

> OK with this nit fixed (if you agree).  Thanks!


[testsuite] [ppc] skip ppc-fortran if fortran is disabled

Skip ppc-fortran.exp if a trivial fortran program cannot be compiled.


for  gcc/testsuite/ChangeLog

	* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: Test for
	fortran compiler, skip if missing.
---
 .../gcc.target/powerpc/ppc-fortran/ppc-fortran.exp |   10 ++++++++++
 1 file changed, 10 insertions(+)

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 f7e99ac848753..f7b7c05487cda 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
@@ -21,6 +21,16 @@ if { ![istarget powerpc*-*-*] && ![istarget rs6000-*-*] } then {
   return
 }
 
+# Make sure there is a fortran compiler to test.
+if { ![check_no_compiler_messages fortran_available assembly {
+! Fortran
+program P
+  stop
+end program P
+} ""] } {
+    return
+}
+
 # Load support procs.
 load_lib gfortran-dg.exp
 


-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

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

end of thread, other threads:[~2023-04-07  3:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06  6:19 [PATCH] [testsuite] [ppc] skip ppc-fortran if fortran is disabled Alexandre Oliva
2023-04-06  8:32 ` Kewen.Lin
2023-04-07  3:41   ` Alexandre Oliva

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).