3 ! Coarray support -- corank declarations
7 subroutine valid(n, c, f)
10 integer, save :: a[*], b(4)[-1:4,*]
11 real :: c(*)[1,0:3,3:*]
12 real :: f(n)[0:n,-100:*]
13 integer, allocatable :: d[:], e(:)[:,:]
14 integer, save, codimension[1,*] :: g, h(7), i(6)[*], j[*]
20 integer, save :: kk[ii, *] ! { dg-error "cannot have the SAVE attribute" }
26 integer, allocatable :: a[:]
28 type, extends(t) :: tt
29 integer, allocatable :: b[:]
32 type(tt) :: bar ! { dg-error "is a coarray or has a coarray component" }
38 integer :: k[*] ! { dg-error "not ALLOCATABLE, SAVE nor a dummy" }
39 integer :: h(3)[*] ! { dg-error "not ALLOCATABLE, SAVE nor a dummy" }
41 codimension :: a[1,*] ! { dg-error "Duplicate CODIMENSION attribute" }
42 complex, save :: hh(n)[*] ! { dg-error "cannot have the SAVE attribute" }
45 integer, save :: hf1[j,*] ! { dg-error "cannot appear in the expression|cannot have the SAVE attribute" }
46 integer, save :: hf2[n,*] ! { dg-error "cannot have the SAVE attribute" }
47 integer, save :: hf3(4)[j,*] ! { dg-error "cannot appear in the expression|cannot have the SAVE attribute" }
48 integer, save :: hf4(5)[n,*] ! { dg-error "cannot have the SAVE attribute" }
50 integer, allocatable :: a2[*] ! { dg-error "must have deferred shape" }
51 integer, allocatable :: a3(:)[*] ! { dg-error "must have deferred shape" }
52 integer, allocatable :: a4[*] ! { dg-error "must have deferred shape" }
53 end subroutine invalid
59 integer, allocatable :: a[:,:,:]
63 type, extends(t) :: tt ! { dg-error "has a coarray component, parent type" }
64 integer, allocatable :: a[:]
67 integer, pointer :: a[:] ! { dg-error "must be allocatable" }
70 integer, allocatable :: b[4,*] ! { dg-error "with deferred shape" }
73 type(c_ptr), allocatable :: p[:] ! { dg-error "shall not be a coarray" }
75 type(t0), save :: t0_1[*] ! { dg-error "shall be a nonpointer, nonallocatable scalar" }
76 type(t0), allocatable :: t0_2[:] ! { dg-error "shall be a nonpointer, nonallocatable scalar" }
77 type(c_ptr), save :: pp[*] ! { dg-error "shall not be a coarray" }
78 end subroutine invalid2
80 elemental subroutine elem(a) ! { dg-error "Coarray dummy argument" }
81 integer, intent(in) :: a[*]
84 function func() result(res)
85 integer :: res[*] ! { dg-error "CODIMENSION attribute conflicts with RESULT" }