gcc/testsuite/gfortran.dg/coarray/coindexed_6.f90
raw| 1 | !{ dg-do compile } |
| 2 | |
| 3 | ! Check PR120843 is fixed |
| 4 | |
| 5 | program p |
| 6 | implicit none |
| 7 | |
| 8 | type T |
| 9 | integer, allocatable :: arr(:,:) [:,:] |
| 10 | end type |
| 11 | |
| 12 | type(T) :: o |
| 13 | integer, allocatable :: vec(:)[:,:] |
| 14 | integer :: c[*] |
| 15 | |
| 16 | c = 7 |
| 17 | |
| 18 | allocate(o%arr(4,3)[2,*], source=6) |
| 19 | allocate(vec(10)[1,*], source=7) |
| 20 | |
| 21 | if (vec(3) * c /= 49) stop 1 |
| 22 | if (o%arr(2,2)* c /= 42) stop 2 |
| 23 | |
| 24 | end program p |