PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_alloc_1.f90
blob6b770779c6fc250076560f62a3efd956e2f2b936
1 ! PR 21104. Make sure that either f() or its caller will allocate
2 ! the array data. We've decided to make the caller allocate it.
3 ! { dg-do run }
4 program main
5 implicit none
6 call test (f ())
7 contains
8 subroutine test (x)
9 integer, dimension (10) :: x
10 integer :: i
11 do i = 1, 10
12 if (x (i) .ne. i * 100) STOP 1
13 end do
14 end subroutine test
16 function f ()
17 integer, dimension (10) :: f
18 integer :: i
19 forall (i = 1:10) f (i) = i * 100
20 end function f
21 end program main