1 !==================assumed_size_refs_1.f90==================
3 ! Test the fix for PR20868 & PR20870 in which references to
4 ! assumed size arrays without an upper bound to the last
5 ! dimension were generating no error.
7 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
9 program assumed_size_test_2
18 real, target
:: m(1:2, *)
20 real, pointer :: q(:,:)
24 q
= cos (1.0 + abs(m
)) ! { dg-error "upper bound in the last dimension" }
26 x
= reshape (m
, (/2,2,2/)) ! { dg-error "upper bound in the last dimension" }
29 print *, ubound (m
) ! { dg-error "upper bound in the last dimension" }
33 print *, size (m
) ! { dg-error "upper bound in the last dimension" }
35 ! Check non-array valued intrinsics
36 print *, ubound (m
, 1)
37 print *, ubound (m
, 2) ! { dg-error "not a valid dimension index" }
44 end program assumed_size_test_2