summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_with_source_19.f08
blob: ff8451093a842c956e7a34d6aa5ab0173d07f62c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do compile }
! { dg-options -std=f2008 }

! Contributed by mrestelli@gmail.com
! Check that instead of an ICE the error message is emitted.

module m
 implicit none
contains

 subroutine s()
  real, allocatable :: x(:)
  real :: y

   y = 5.0
   ! x either needs an array spec, or y needs to be an array.
   allocate( x , source=y ) ! { dg-error "Array specification or array-valued SOURCE= expression required in ALLOCATE statement" }

 end subroutine s

end module m