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[*]
21 integer, save :: kk[ii, *] ! { dg-error "cannot have the SAVE attribute" }
27 integer, allocatable :: a[:]
29 type, extends(t) :: tt
30 integer, allocatable :: b[:]
33 type(tt) :: bar ! { dg-error "is a coarray or has a coarray component" }
39 integer :: k[*] ! { dg-error "not ALLOCATABLE, SAVE nor a dummy" }
40 integer :: h(3)[*] ! { dg-error "not ALLOCATABLE, SAVE nor a dummy" }
42 codimension :: a[1,*] ! { dg-error "Duplicate CODIMENSION attribute" }
43 complex, save :: hh(n)[*] ! { dg-error "cannot have the SAVE attribute" }
46 integer, save :: hf1[j,*] ! { dg-error "cannot appear in the expression|cannot have the SAVE attribute" }
47 integer, save :: hf2[n,*] ! { dg-error "cannot have the SAVE attribute" }
48 integer, save :: hf3(4)[j,*] ! { dg-error "cannot appear in the expression|cannot have the SAVE attribute" }
49 integer, save :: hf4(5)[n,*] ! { dg-error "cannot have the SAVE attribute" }
51 integer, allocatable :: a2[*] ! { dg-error "must have deferred shape" }
52 integer, allocatable :: a3(:)[*] ! { dg-error "must have deferred shape" }
53 integer, allocatable :: a4[*] ! { dg-error "must have deferred shape" }
54 end subroutine invalid
60 integer, allocatable :: a[:,:,:]
64 type, extends(t) :: tt ! { dg-error "has a coarray component, parent type" }
65 integer, allocatable :: a[:]
68 integer, pointer :: a[:] ! { dg-error "must be allocatable" }
71 integer, allocatable :: b[4,*] ! { dg-error "with deferred shape" }
74 type(c_ptr), allocatable :: p[:] ! { dg-error "shall not be a coarray" }
76 type(t0), save :: t0_1[*] ! { dg-error "shall be a nonpointer, nonallocatable scalar" }
77 type(t0), allocatable :: t0_2[:] ! { dg-error "shall be a nonpointer, nonallocatable scalar" }
78 type(c_ptr), save :: pp[*] ! { dg-error "shall not be a coarray" }
79 end subroutine invalid2
81 elemental subroutine elem(a) ! { dg-error "Coarray dummy argument" }
82 integer, intent(in) :: a[*]
85 function func() result(res)
86 integer :: res[*] ! { dg-error "CODIMENSION attribute conflicts with RESULT" }