Debian Codegraph @

gcc/testsuite/gfortran.dg/intent_out_19.f90

raw
1 ! { dg-do run }
2 !
3 ! PR fortran/92178
4 ! Check that if a data reference passed is as actual argument whose dummy
5 ! has INTENT(OUT) attribute, any other argument depending on the
6 ! same data reference is evaluated before the data reference deallocation.
7
8 program p
9 implicit none
10 class(*), allocatable :: c
11 c = 3
12 call bar (allocated(c), c, allocated (c))
13 if (allocated (c)) stop 14
14 contains
15 subroutine bar (alloc, x, alloc2)
16 logical :: alloc, alloc2
17 class(*), allocatable, intent(out) :: x(..)
18 if (allocated (x)) stop 5
19 if (.not. alloc) stop 6
20 if (.not. alloc2) stop 16
21 end subroutine bar
22 end