summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pure_initializer_1.f90
blob: 6f521a04f6440382c7c18f2e4ee3d0f23525dba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do compile }
! Tests the fix for PR32881, in which the initialization
! of 'p' generated an error because the pureness of 'bar'
! escaped.
!
! Contributed by Janne Blomqvist <jb@gcc.gnu.org>
!
subroutine foo ()
  integer, pointer :: p => NULL()
contains
  pure function bar (a)
    integer, intent(in) :: a
    integer :: bar
    bar = a
  end function bar
end subroutine foo