gcc/fortran/
[official-gcc.git] / gcc / testsuite / gfortran.dg / intrinsic_1.f90
blob15c0d39ac17e76b653c542240924b934daddd571
1 ! { dg-do compile }
3 ! PR 39861/39864
5 ! Test cases provided by Dominique d'Humieres <dominiq@lps.ens.fr>
6 ! and Michael Richmond <michael.a.richmond@nasa.gov>.
8 module vector_calculus
9 intrinsic :: dot_product, sqrt
11 contains
13 function len(r)
14 real, dimension(:), intent(in) :: r
15 real :: len
16 len = sqrt(dot_product(r,r))
17 end function len
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
25 end module vector_calculus