Debian Codegraph @

gcc/testsuite/gfortran.dg/array_constructor_57.f90

raw
1 ! { dg-do run }
2 ! PR fortran/93483
3 !
4 ! Verify that resolution (host associated parameter vs. contained function) works.
5 !
6 ! Contributed by Mikael Morin
7
8 module m
9 implicit none
10 integer, parameter :: a(*) = [ 7, 11 ]
11 contains
12 subroutine bug
13 real :: b(1), c(1)
14 b = [ real :: (a(1)) ]
15 c = [ real :: a(1) ]
16 print *, b, c
17 if (any (b /= [ 14. ])) stop 1
18 if (any (c /= [ 14. ])) stop 2
19 contains
20 function a(c)
21 integer :: a, c
22 a = c + 13
23 end function a
24 end subroutine bug
25 end module m
26
27 program p
28 use m
29 call bug
30 end program p