diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/intrinsic_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/intrinsic_1.f90 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_1.f90 new file mode 100644 index 000000000..b2413de1a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intrinsic_1.f90 @@ -0,0 +1,28 @@ +! { 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 + +! { dg-final { cleanup-modules "vector_calculus" } } + |