1! { dg-do compile }
2!
3! PR 39861/39864
4!
5! Test cases provided by Dominique d'Humieres <dominiq@lps.ens.fr>
6! and Michael Richmond <michael.a.richmond@nasa.gov>.
7
8module vector_calculus
9  intrinsic :: dot_product, sqrt
10
11contains
12
13  function len(r)
14    real, dimension(:), intent(in) :: r
15    real :: len
16    len = sqrt(dot_product(r,r))
17  end function len
18
19  FUNCTION next_state()
20    INTRINSIC :: RESHAPE
21    INTEGER, PARAMETER :: trantb(1,1) = RESHAPE((/1,2/), shape=(/1,1/))
22    next_state = trantb(1, 1)
23  END FUNCTION next_state
24
25end module vector_calculus
26