32 lines
1.2 KiB
Text
32 lines
1.2 KiB
Text
|
! RUN: %python %S/test_errors.py %s %flang_fc1
|
||
|
module m
|
||
|
real, constant :: rc
|
||
|
!ERROR: Object 'rcp' with ATTRIBUTES(CONSTANT) may not be allocatable, pointer, or target
|
||
|
real, constant, pointer :: rcp
|
||
|
!ERROR: Object 'rct' with ATTRIBUTES(CONSTANT) may not be allocatable, pointer, or target
|
||
|
real, constant, target :: rct
|
||
|
real, device, pointer :: dp(:)
|
||
|
real, device, target :: dt(100)
|
||
|
contains
|
||
|
attributes(device) subroutine devsub
|
||
|
!ERROR: Left-hand side of assignment is not definable
|
||
|
!BECAUSE: 'rc' has ATTRIBUTES(CONSTANT) and is not definable in a device subprogram
|
||
|
rc = 1.
|
||
|
!ERROR: The left-hand side of a pointer assignment is not definable
|
||
|
!BECAUSE: 'dp' is a pointer and may not be associated in a device subprogram
|
||
|
dp => dt
|
||
|
end
|
||
|
attributes(global) subroutine globsub
|
||
|
!ERROR: Left-hand side of assignment is not definable
|
||
|
!BECAUSE: 'rc' has ATTRIBUTES(CONSTANT) and is not definable in a device subprogram
|
||
|
rc = 1.
|
||
|
!ERROR: The left-hand side of a pointer assignment is not definable
|
||
|
!BECAUSE: 'dp' is a pointer and may not be associated in a device subprogram
|
||
|
dp => dt
|
||
|
end
|
||
|
subroutine hostsub
|
||
|
rc = 1.
|
||
|
dp => dt
|
||
|
end
|
||
|
end
|