From 78b0551a68d1a7e60e549a4852fe78e600ce5320 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sun, 30 Sep 2012 16:54:28 +0200 Subject: [PATCH] allocate_derived_1.f90: Re-enable class array checks, partially reverting r170092. 2012-09-30 Janus Weil * gfortran.dg/allocate_derived_1.f90: Re-enable class array checks, partially reverting r170092. * gfortran.dg/class_7.f03: Ditto. * gfortran.dg/coarray_14.f90: Ditto. * gfortran.dg/typebound_proc_13.f03: Ditto. From-SVN: r191867 --- gcc/testsuite/ChangeLog | 8 ++++++ .../gfortran.dg/allocate_derived_1.f90 | 27 +++++++++---------- gcc/testsuite/gfortran.dg/class_7.f03 | 3 +-- gcc/testsuite/gfortran.dg/coarray_14.f90 | 2 +- .../gfortran.dg/typebound_proc_13.f03 | 9 +++---- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8578075ec2d..2934e0ad14b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2012-09-30 Janus Weil + + * gfortran.dg/allocate_derived_1.f90: Re-enable class array checks, + partially reverting r170092. + * gfortran.dg/class_7.f03: Ditto. + * gfortran.dg/coarray_14.f90: Ditto. + * gfortran.dg/typebound_proc_13.f03: Ditto. + 2012-09-29 Paolo Carlini PR c++/54738 diff --git a/gcc/testsuite/gfortran.dg/allocate_derived_1.f90 b/gcc/testsuite/gfortran.dg/allocate_derived_1.f90 index 648012431ac..d2c65ffa38b 100644 --- a/gcc/testsuite/gfortran.dg/allocate_derived_1.f90 +++ b/gcc/testsuite/gfortran.dg/allocate_derived_1.f90 @@ -24,28 +24,27 @@ real :: r end type -! FIXME: uncomment and dejagnuify the lines below once class arrays are enabled -! class(t1),dimension(:),allocatable :: x + class(t1),dimension(:),allocatable :: x type(t2),dimension(:),allocatable :: y -! class(t3),dimension(:),allocatable :: z + class(t3),dimension(:),allocatable :: z -! allocate( x(1)) -! allocate(t1 :: x(2)) -! allocate(t2 :: x(3)) -! allocate(t3 :: x(4)) -! allocate(tx :: x(5)) ! { "Error in type-spec at" } -! allocate(u0 :: x(6)) ! { "may not be ABSTRACT" } -! allocate(v1 :: x(7)) ! { "is type incompatible with typespec" } + allocate( x(1)) + allocate(t1 :: x(2)) + allocate(t2 :: x(3)) + allocate(t3 :: x(4)) + allocate(tx :: x(5)) ! { dg-error "Error in type-spec at" } + allocate(u0 :: x(6)) ! { dg-error "may not be ABSTRACT" } + allocate(v1 :: x(7)) ! { dg-error "is type incompatible with typespec" } allocate( y(1)) allocate(t1 :: y(2)) ! { dg-error "is type incompatible with typespec" } allocate(t2 :: y(3)) allocate(t3 :: y(3)) ! { dg-error "is type incompatible with typespec" } -! allocate( z(1)) -! allocate(t1 :: z(2)) ! { "is type incompatible with typespec" } -! allocate(t2 :: z(3)) ! { "is type incompatible with typespec" } -! allocate(t3 :: z(4)) + allocate( z(1)) + allocate(t1 :: z(2)) ! { dg-error "is type incompatible with typespec" } + allocate(t2 :: z(3)) ! { dg-error "is type incompatible with typespec" } + allocate(t3 :: z(4)) end diff --git a/gcc/testsuite/gfortran.dg/class_7.f03 b/gcc/testsuite/gfortran.dg/class_7.f03 index d7f1c835ef4..99fbf6fc69b 100644 --- a/gcc/testsuite/gfortran.dg/class_7.f03 +++ b/gcc/testsuite/gfortran.dg/class_7.f03 @@ -9,8 +9,7 @@ end type t0 type t integer :: i -! FIXME: uncomment and dejagnuify once class arrays are enabled -! class(t0), allocatable :: foo(3) ! { "deferred shape" } + class(t0), allocatable :: foo(3) ! { dg-error "deferred shape" } end type t ! PR41608: Would ICE on missing type decl diff --git a/gcc/testsuite/gfortran.dg/coarray_14.f90 b/gcc/testsuite/gfortran.dg/coarray_14.f90 index 3097eede757..d7eb6b6be02 100644 --- a/gcc/testsuite/gfortran.dg/coarray_14.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_14.f90 @@ -47,7 +47,7 @@ end subroutine test program myTest type t end type t -type(t), allocatable :: a[:] +class(t), allocatable :: a[:] allocate (t :: a) ! { dg-error "Coarray specification required in ALLOCATE statement" } allocate (t :: a[*]) ! OK end program myTest diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_13.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_13.f03 index af486ff7684..98caac69245 100644 --- a/gcc/testsuite/gfortran.dg/typebound_proc_13.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_proc_13.f03 @@ -16,8 +16,7 @@ MODULE m TYPE t2 CONTAINS -! FIXME: uncomment and dejagnuify once class arrays are enabled -! PROCEDURE, PASS :: nonscalar ! { "must be scalar" } + PROCEDURE, PASS :: nonscalar ! { dg-error "must be scalar" } PROCEDURE, PASS :: is_pointer ! { dg-error "must not be POINTER" } PROCEDURE, PASS :: is_allocatable ! { dg-error "must not be ALLOCATABLE" } END TYPE t2 @@ -27,9 +26,9 @@ CONTAINS SUBROUTINE myproc () END SUBROUTINE myproc -! SUBROUTINE nonscalar (me) -! CLASS(t2), INTENT(IN) :: me(:) -! END SUBROUTINE nonscalar + SUBROUTINE nonscalar (me) + CLASS(t2), INTENT(IN) :: me(:) + END SUBROUTINE nonscalar SUBROUTINE is_pointer (me) CLASS(t2), POINTER, INTENT(IN) :: me