aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr98016.f90
blob: 71df67e6190ed58b8d794b58afa598b504749e49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
! { dg-do compile }
!
! Fix for PR98016 - Used to fail with Error: Variable ā€˜nā€™ cannot appear in the
! expression at (1) for line 16. Workaround was to declare y to be real.
!
! Posted by Juergen Reuter  <juergen.reuter@desy.de>
!
program is_it_valid
  dimension y(3)
  n=3
  y=func(1.0)
  print *, y
  stop
contains
  function func(x) result (y)
    dimension y(n)
    y=x
  end function
end