X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Ftestsuite%2Fgfortran.dg%2Fcoarray_6.f90;h=b6d8b4952d24e53e39a27d1d96e2b2d2ef0d7010;hp=f122fd451f3753d28203dc512cd38713d0f60ccf;hb=47f214b1a234ead0d9a00bf23e2e7e2e8bbf6e7d;hpb=7f03e37747deabe0c0c039eb1458132d0318303d diff --git a/gcc/testsuite/gfortran.dg/coarray_6.f90 b/gcc/testsuite/gfortran.dg/coarray_6.f90 index f122fd451f3..b6d8b4952d2 100644 --- a/gcc/testsuite/gfortran.dg/coarray_6.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_6.f90 @@ -51,6 +51,32 @@ function func() result(func2) ! { dg-error "shall not be a coarray or have a coa type(t) :: func2 end function func +subroutine invalid() + type t + integer, allocatable :: a[:] + end type t + type t2 + type(t), allocatable :: b ! { dg-error "nonpointer, nonallocatable scalar" } + end type t2 + type t3 + type(t), pointer :: c ! { dg-error "nonpointer, nonallocatable scalar" } + end type t3 + type t4 + type(t) :: d(4) ! { dg-error "nonpointer, nonallocatable scalar" } + end type t4 +end subroutine invalid + +subroutine valid(a) + integer :: a(:)[4,-1:6,4:*] + type t + integer, allocatable :: a[:] + end type t + type t2 + type(t) :: b + end type t2 + type(t2), save :: xt2[*] +end subroutine valid + program main integer :: A[*] ! Valid, implicit SAVE attribute end program main