| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! TS 29113 |
| 4 |
! C535a An assumed-rank entity shall be a dummy variable that does not |
| 5 |
! have the CODIMENSION or VALUE attribute. |
| 6 |
! An assumed-rank object may have the CONTIGUOUS attribute. |
| 7 |
! |
| 8 |
! This test file contains tests that are expected to all pass. |
| 9 |
|
| 10 |
! Check basic usage with no attributes. |
| 11 |
|
| 12 |
module m |
| 13 |
type :: t |
| 14 |
integer :: i |
| 15 |
real :: f |
| 16 |
end type |
| 17 |
end module |
| 18 |
|
| 19 |
subroutine s0 (a, b, c, d) |
| 20 |
use m |
| 21 |
implicit none |
| 22 |
integer :: a(..) |
| 23 |
real :: b(..) |
| 24 |
type(t) :: c(..) |
| 25 |
type(*) :: d(..) |
| 26 |
end subroutine |
| 27 |
|
| 28 |
! Likewise with dimension attribute. |
| 29 |
|
| 30 |
subroutine s1 (a, b, c, d) |
| 31 |
use m |
| 32 |
implicit none |
| 33 |
integer, dimension(..) :: a |
| 34 |
real, dimension(..) :: b |
| 35 |
type(t), dimension(..) :: c |
| 36 |
type(*), dimension(..) :: d |
| 37 |
end subroutine |
| 38 |
|
| 39 |
! Likewise with dimension statement. |
| 40 |
|
| 41 |
subroutine s2 (a, b, c, d) |
| 42 |
use m |
| 43 |
implicit none |
| 44 |
integer :: a |
| 45 |
real :: b |
| 46 |
type(t) :: c |
| 47 |
type(*) :: d |
| 48 |
dimension a(..), b(..), c(..), d(..) |
| 49 |
end subroutine |
| 50 |
|
| 51 |
! Test that various other attributes are accepted. |
| 52 |
|
| 53 |
subroutine s3 (a, b, c, d, e, f, g, h, i, j) |
| 54 |
implicit none |
| 55 |
integer, allocatable :: a(..) |
| 56 |
integer, asynchronous :: b(..) |
| 57 |
integer, contiguous :: c(..) |
| 58 |
integer, intent(in) :: d(..) |
| 59 |
integer, intent(out) :: e(..) |
| 60 |
integer, intent(inout) :: f(..) |
| 61 |
integer, optional :: g(..) |
| 62 |
integer, pointer :: h(..) |
| 63 |
integer, target :: i(..) |
| 64 |
integer, volatile :: j(..) |
| 65 |
end subroutine |