summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/select_rank_3.f90
blob: 35cd8cd9a0e2a1ae79a940f823c123e1d8edef61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do compile }
!
! Test the fix for PR91729
!
! Contributed by Gerhardt Steinmetz  <gscfq@t-online.de>
!
subroutine s(x)
   integer :: x(..)
   select rank (-x)       ! { dg-error "must be an assumed rank" }
     rank (1)             ! { dg-error "Unexpected RANK statement" }
       print *, x         ! { dg-error "may only be used as actual argument" }
   end select             ! { dg-error "Expecting END SUBROUTINE" }
end

subroutine t(x)
   integer :: x(..)
   select rank (z => -x)  ! { dg-error "must be an assumed rank" }
     rank (1)             ! { dg-error "Unexpected RANK statement" }
       print *, z
   end select             ! { dg-error "Expecting END SUBROUTINE" }
end