mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-28 11:30:19 +00:00
18 lines
362 B
Fortran
18 lines
362 B
Fortran
! { dg-do run }
|
|
! PR 22607: PURE return-by-reference functions
|
|
program main
|
|
implicit none
|
|
integer, dimension(2) :: b
|
|
b = fun(size(b))
|
|
if (b(1) /= 1 .or. b(2) /= 2) STOP 1
|
|
contains
|
|
pure function fun(n)
|
|
integer, intent(in) :: n
|
|
integer :: fun(n)
|
|
integer :: i
|
|
do i = 1, n
|
|
fun(i) = i
|
|
end do
|
|
end function fun
|
|
end program main
|