| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fcoarray=single" } |
| 3 |
! |
| 4 |
! Coarray declaration constraint checks |
| 5 |
! |
| 6 |
|
| 7 |
function foo3a() result(res) |
| 8 |
implicit none |
| 9 |
integer :: res |
| 10 |
codimension :: res[*] ! { dg-error "CODIMENSION attribute conflicts with RESULT" } |
| 11 |
end |
| 12 |
|
| 13 |
function foo2a() result(res) |
| 14 |
integer :: res[*] ! { dg-error "CODIMENSION attribute conflicts with RESULT" } |
| 15 |
end |
| 16 |
|
| 17 |
function fooa() result(res) ! { dg-error "shall not be a coarray or have a coarray component" } |
| 18 |
implicit none |
| 19 |
type t |
| 20 |
integer, allocatable :: A[:] |
| 21 |
end type t |
| 22 |
type(t):: res |
| 23 |
end |
| 24 |
|
| 25 |
function foo3() ! { dg-error "shall not be a coarray or have a coarray component" } |
| 26 |
implicit none |
| 27 |
integer :: foo3 |
| 28 |
codimension :: foo3[*] |
| 29 |
end |
| 30 |
|
| 31 |
function foo2() ! { dg-error "shall not be a coarray or have a coarray component" } |
| 32 |
implicit none |
| 33 |
integer :: foo2[*] |
| 34 |
end |
| 35 |
|
| 36 |
function foo() ! { dg-error "shall not be a coarray or have a coarray component" } |
| 37 |
type t |
| 38 |
integer, allocatable :: A[:] |
| 39 |
end type t |
| 40 |
type(t):: foo |
| 41 |
end |
| 42 |
|
| 43 |
subroutine test() |
| 44 |
use iso_c_binding |
| 45 |
implicit none |
| 46 |
type(c_ptr), save :: caf[*] ! { dg-error "shall not be a coarray" } |
| 47 |
end subroutine test |
| 48 |
|
| 49 |
subroutine test2() |
| 50 |
use iso_c_binding |
| 51 |
implicit none |
| 52 |
type(c_funptr), save :: caf[*] ! { dg-error "shall not be a coarray" } |
| 53 |
end subroutine test2 |