gcc/testsuite/gfortran.dg/pointer_assign_14.f90
raw| 1 | ! { dg-do run } |
| 2 | ! PR fortran/94578 |
| 3 | ! This used to give wrong results. |
| 4 | program main |
| 5 | implicit none |
| 6 | type foo |
| 7 | integer :: x, y,z |
| 8 | end type foo |
| 9 | integer :: i |
| 10 | integer, dimension(:), pointer :: array1d |
| 11 | type(foo), dimension(2), target :: solution |
| 12 | integer, dimension(2,2) :: a |
| 13 | data a /1,2,3,4/ |
| 14 | solution%x = -10 |
| 15 | solution%y = -20 |
| 16 | array1d => solution%x |
| 17 | array1d = maxval(a,dim=1) |
| 18 | if (any (array1d /= [2,4])) stop 1 |
| 19 | end program main |