Debian Codegraph @

gcc/testsuite/gfortran.dg/allocate_with_source_19.f08

raw
1 ! { dg-do compile }
2 ! { dg-options -std=f2008 }
3
4 ! Contributed by [email protected]
5 ! Check that instead of an ICE the error message is emitted.
6
7 module m
8 implicit none
9 contains
10
11 subroutine s()
12 real, allocatable :: x(:)
13 real :: y
14
15 y = 5.0
16 ! x either needs an array spec, or y needs to be an array.
17 allocate( x , source=y ) ! { dg-error "Array specification or array-valued SOURCE= expression required in ALLOCATE statement" }
18
19 end subroutine s
20
21 end module m
22