aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/intrinsic_1.f90
blob: 15c0d39ac17e76b653c542240924b934daddd571 (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
! { dg-do compile }
!
! PR 39861/39864
!
! Test cases provided by Dominique d'Humieres <dominiq@lps.ens.fr>
! and Michael Richmond <michael.a.richmond@nasa.gov>.

module vector_calculus
  intrinsic :: dot_product, sqrt

contains

  function len(r)
    real, dimension(:), intent(in) :: r
    real :: len
    len = sqrt(dot_product(r,r))
  end function len

  FUNCTION next_state()
    INTRINSIC :: RESHAPE
    INTEGER, PARAMETER :: trantb(1,1) = RESHAPE((/1,2/), shape=(/1,1/))
    next_state = trantb(1, 1)
  END FUNCTION next_state

end module vector_calculus