summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/assumed_shape_ranks_1.f90
blob: e24414ad355a4cf920a0cc82964a7e11a219b968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
! { dg-do compile }
! Tests fix for PR25070; was no error for actual and assumed shape
! dummy ranks not matching.
! Contributed by Joost VandeVondele  <jv244@cam.ac.uk>

module addon
  interface extra
    function foo (y)
      integer :: foo (2), y (:)
    end function foo
  end interface extra
end module addon

  use addon
  INTEGER :: I(2,2)
  I=RESHAPE((/1,2,3,4/),(/2,2/))
  CALL TST(I)   ! { dg-error "Rank mismatch in argument" }
  i = foo (i)   ! { dg-error "Rank mismatch|Incompatible ranks" }
CONTAINS
  SUBROUTINE TST(I)
    INTEGER :: I(:)
    write(6,*) I
  END SUBROUTINE TST
END

! { dg-final { cleanup-modules "addon" } }