summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocatable_scalar_11.f90
blob: b9fb1085760688c91d1ed77e82e33ad00021d3d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
! { dg-do compile }
!
! PR fortran/46484
!

function g()
  implicit none
  integer, allocatable :: g
  call int()
    print *, loc(g) ! OK
contains
  subroutine int()
    print *, loc(g) ! OK
    print *, allocated(g) ! OK
  end subroutine int
end function

implicit none
integer, allocatable :: x
print *, allocated(f) ! { dg-error "must be a variable" }
print *, loc(f) ! OK
contains
function f()
  integer, allocatable :: f
  print *, loc(f) ! OK
  print *, allocated(f) ! OK
end function
end