2 ! { dg-options "-fcoarray=single" }
4 ! Coarray support -- corank declarations
8 subroutine valid(n
, c
, f
)
11 integer, save :: a
[*], b(4)[-1:4,*]
12 real :: c(*)[1,0:3,3:*]
13 real :: f(n
)[0:n
,-100:*]
14 integer, allocatable
:: d
[:], e(:)[:,:]
15 integer, save, codimension
[1,*] :: g
, h(7), i(6)[*], j
[*]
22 integer, save :: kk
[j
, *] ! { dg-error "Variable .j. cannot appear in the expression" }
28 integer, allocatable
:: a
[:]
30 type, extends(t
) :: tt
31 integer, allocatable
:: b
[:]
40 integer :: k
[*] ! { dg-error "not ALLOCATABLE, SAVE nor a dummy" }
41 integer :: h(3)[*] ! { dg-error "not ALLOCATABLE, SAVE nor a dummy" }
43 codimension
:: a
[1,*] ! { dg-error "Duplicate CODIMENSION attribute" }
44 complex, save :: hh(n
)[*] ! { dg-error "cannot have the SAVE attribute" }
47 integer, save :: hf1
[j
,*] ! { dg-error "cannot appear in the expression" }
48 integer, save :: hf2
[n
,*] ! OK
49 integer, save :: hf3(4)[j
,*] ! { dg-error "cannot appear in the expression|cannot have the SAVE attribute" }
50 integer, save :: hf4(5)[n
,*] ! OK
52 integer, allocatable
:: a2
[*] ! { dg-error "must have deferred shape" }
53 integer, allocatable
:: a3(:)[*] ! { dg-error "must have deferred shape" }
54 integer, allocatable
:: a4
[*] ! { dg-error "must have deferred shape" }
55 end subroutine invalid
61 integer, allocatable
:: a
[:,:,:]
65 type, extends(t
) :: tt
! { dg-error "has a coarray component, parent type" }
66 integer, allocatable
:: a
[:]
69 integer, pointer :: a
[:] ! { dg-error "must be allocatable" }
72 integer, allocatable
:: b
[4,*] ! { dg-error "with deferred shape" }
75 type(c_ptr
), allocatable
:: p
[:] ! { dg-error "shall not be a coarray" }
77 type(t0
), save :: t0_1
[*] ! { dg-error "shall be a nonpointer, nonallocatable scalar" }
78 type(t0
), allocatable
:: t0_2
[:] ! { dg-error "shall be a nonpointer, nonallocatable scalar" }
79 type(c_ptr
), save :: pp
[*] ! { dg-error "shall not be a coarray" }
80 end subroutine invalid2
82 elemental
subroutine elem(a
) ! { dg-error "Coarray dummy argument" }
83 integer, intent(in
) :: a
[*]
86 function func() result(res
)
87 integer :: res
[*] ! { dg-error "CODIMENSION attribute conflicts with RESULT" }