public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-4473] Fortran: intrinsic MERGE shall use all its arguments [PR107874]
@ 2022-12-02 21:35 Harald Anlauf
  0 siblings, 0 replies; only message in thread
From: Harald Anlauf @ 2022-12-02 21:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:36a4ee406b95ae24a59b8b3f8ebe29af6fd5261e

commit r13-4473-g36a4ee406b95ae24a59b8b3f8ebe29af6fd5261e
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Fri Dec 2 22:30:16 2022 +0100

    Fortran: intrinsic MERGE shall use all its arguments [PR107874]
    
    gcc/testsuite/ChangeLog:
    
            PR fortran/107874
            * gfortran.dg/merge_1.f90: Avoid recursive I/O.

Diff:
---
 gcc/testsuite/gfortran.dg/merge_1.f90 | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/merge_1.f90 b/gcc/testsuite/gfortran.dg/merge_1.f90
index abbc2276b1c..437b13a8d3f 100644
--- a/gcc/testsuite/gfortran.dg/merge_1.f90
+++ b/gcc/testsuite/gfortran.dg/merge_1.f90
@@ -7,32 +7,40 @@ program testmerge9
   integer :: i
   logical :: x(2) = (/.true., .false./)
   logical :: called(2)
+  logical :: y
 
   ! At run-time all arguments shall be evaluated
   do i = 1,2
      called = .false.
-     print *, merge (tstuff(), fstuff(), x(i))
+     y = merge (tstuff(), fstuff(), x(i))
+     print *, y
      if (any (.not. called)) stop 1
   end do
 
   ! Compile-time simplification shall not drop non-constant args
   called = .false.
-  print *, merge (tstuff(),fstuff(),.true.)
+  y = merge (tstuff(),fstuff(),.true.)
+  print *, y
   if (any (.not. called)) stop 2
   called = .false.
-  print *, merge (tstuff(),fstuff(),.false.)
+  y = merge (tstuff(),fstuff(),.false.)
+  print *, y
   if (any (.not. called)) stop 3
   called = .false.
-  print *, merge (tstuff(),.false.,.true.)
+  y = merge (tstuff(),.false.,.true.)
+  print *, y
   if (any (called .neqv. [.true.,.false.])) stop 4
   called = .false.
-  print *, merge (tstuff(),.false.,.false.)
+  y = merge (tstuff(),.false.,.false.)
+  print *, y
   if (any (called .neqv. [.true.,.false.])) stop 5
   called = .false.
-  print *, merge (.true.,fstuff(),.true.)
+  y = merge (.true.,fstuff(),.true.)
+  print *, y
   if (any (called .neqv. [.false.,.true.])) stop 6
   called = .false.
-  print *, merge (.true.,fstuff(),.false.)
+  y = merge (.true.,fstuff(),.false.)
+  print *, y
   if (any (called .neqv. [.false.,.true.])) stop 7
 contains
   logical function tstuff()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-02 21:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 21:35 [gcc r13-4473] Fortran: intrinsic MERGE shall use all its arguments [PR107874] Harald Anlauf

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