1 !==================assumed_size_refs_1.f90==================
3 ! Test the fix for PR25029, PR21256 in which references to
4 ! assumed size arrays without an upper bound to the last
5 ! dimension were generating no error. The first version of
6 ! the patch failed in DHSEQR, as pointed out by Toon Moene
7 ! in http://gcc.gnu.org/ml/fortran/2005-12/msg00466.html
9 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
11 program assumed_size_test_1
20 real, target :: m(1:2, *)
23 real, pointer :: p(:,:), q(:,:)
27 p => m ! { dg-error "upper bound in the last dimension" }
28 q = m ! { dg-error "upper bound in the last dimension" }
30 ! PR21256( and PR25060)
31 m = 1 ! { dg-error "upper bound in the last dimension" }
35 x = fcn (m) ! { dg-error "upper bound in the last dimension" }
37 call sub (m, x) ! { dg-error "upper bound in the last dimension" }
38 call sub (m(1:2, 1:2), x) ! { dg-error "Incompatible ranks in elemental procedure" }
45 elemental function fcn (a) result (b)
51 elemental subroutine sub (a, b)
52 real, intent(inout) :: a, b
56 SUBROUTINE DHSEQR( WORK )
61 CALL DLARFX( MIN( 1, 8 ), WORK )
64 end program assumed_size_test_1