OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gfortran.dg/] [dummy_functions_1.f90] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
! { dg-do run }
2
! PR 18197: Check that dummy functions with RESULT variable and dimension works.
3
module innerfun
4
contains
5
  function f(n,x) result(y)
6
    integer, intent(in) :: n
7
    real, dimension(:), intent(in) :: x
8
    real, dimension(n) :: y
9
    y = 1
10
  end function f
11
end module innerfun
12
 
13
module outerfun
14
contains
15
   subroutine foo(n,funname)
16
     integer, intent(in) :: n
17
     real, dimension(n) :: y
18
     real, dimension(2) :: x
19
     interface
20
       function funname(n,x) result(y)
21
         integer, intent(in) :: n
22
         real, dimension(:), intent(in) :: x
23
         real, dimension(n)  :: y
24
       end function funname
25
     end interface
26
 
27
     y = funname(n, (/ 0.2, 0.3 /) )
28
     if (any(y /= 1.0)) call abort()
29
 
30
   end subroutine foo
31
end module outerfun
32
 
33
program test
34
   use outerfun
35
   use innerfun
36
   call foo(3,f)
37
end program test
38
 
39
! { dg-final { cleanup-modules "innerfun outerfun" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.