Debian Codegraph @

gcc/testsuite/gfortran.dg/allocatable_scalar_11.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR fortran/46484
4 !
5
6 function g()
7 implicit none
8 integer, allocatable :: g
9 call int()
10 print *, loc(g) ! OK
11 contains
12 subroutine int()
13 print *, loc(g) ! OK
14 print *, allocated(g) ! OK
15 end subroutine int
16 end function
17
18 implicit none
19 integer, allocatable :: x
20 print *, allocated(f) ! { dg-error "must be a variable" }
21 print *, loc(f) ! OK
22 contains
23 function f()
24 integer, allocatable :: f
25 print *, loc(f) ! OK
26 print *, allocated(f) ! OK
27 end function
28 end