27 lines
1,019 B
Text
27 lines
1,019 B
Text
|
! RUN: %python %S/test_errors.py %s %flang_fc1
|
||
|
module m
|
||
|
real, allocatable :: xa
|
||
|
real, allocatable, managed :: ma
|
||
|
contains
|
||
|
attributes(device) subroutine devsubr
|
||
|
real, device, allocatable :: da
|
||
|
real, allocatable, managed :: dma
|
||
|
allocate(da) ! ok
|
||
|
deallocate(da) ! ok
|
||
|
allocate(dma) ! ok
|
||
|
deallocate(dma) ! ok
|
||
|
!ERROR: Name in ALLOCATE statement is not definable
|
||
|
!BECAUSE: 'xa' is a host variable and is not definable in a device subprogram
|
||
|
allocate(xa)
|
||
|
!ERROR: Name in DEALLOCATE statement is not definable
|
||
|
!BECAUSE: 'xa' is a host variable and is not definable in a device subprogram
|
||
|
deallocate(xa)
|
||
|
!ERROR: Name in ALLOCATE statement is not definable
|
||
|
!BECAUSE: 'ma' is a host-associated allocatable and is not definable in a device subprogram
|
||
|
allocate(ma)
|
||
|
!ERROR: Name in DEALLOCATE statement is not definable
|
||
|
!BECAUSE: 'ma' is a host-associated allocatable and is not definable in a device subprogram
|
||
|
deallocate(ma)
|
||
|
end subroutine
|
||
|
end module
|