OSDN Git Service

2010-04-06 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / coarray_6.f90
index f122fd4..b6d8b49 100644 (file)
@@ -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