OSDN Git Service

libcpp:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / intrinsic_1.f90
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
8 module vector_calculus
9   intrinsic :: dot_product, sqrt
10
11 contains
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
25 end module vector_calculus
26
27 ! { dg-final { cleanup-modules "vector_calculus" } }
28