summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pointer_array_9.f90
blob: 4c0336ef361e02a55fe738c1950a4a1661592e2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do run }
!
! Tests fix for PR82184
!
! Contributed by Andrey Guskov  <andrey.y.guskov@intel.com)
!
program r187
  call s()
  call s()
contains
  subroutine s()
    complex(4), allocatable, save :: a(:, :)
    complex(4), pointer,     save :: b(:, :)
    if (.not. associated(b)) then
      allocate(a(2, 2))
      allocate(b(2, 2))
      a = reshape ([cmplx(1, 1), cmplx(2, 2), cmplx(1, 2), cmplx(2, 1)], [2,2])
    else
      b = transpose(a)
      if (merge("PASSED", "FAILED", all (transpose (a) .eq. b)) .eq. "FAILED") STOP 1
    end if
  end subroutine s
end program r187