2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_26.f90
blob06ff4cf79f724214e503ba25f954b6956e1ef08e
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=single" }
4 ! Coarray declaration constraint checks
7 function foo3a() result(res)
8 implicit none
9 integer :: res
10 codimension :: res[*] ! { dg-error "CODIMENSION attribute conflicts with RESULT" }
11 end
13 function foo2a() result(res)
14 integer :: res[*] ! { dg-error "CODIMENSION attribute conflicts with RESULT" }
15 end
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
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
31 function foo2() ! { dg-error "shall not be a coarray or have a coarray component" }
32 implicit none
33 integer :: foo2[*]
34 end
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
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
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