OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / host_assoc_function_6.f90
1 ! { dg-do compile }
2 ! Tests the fix for PR38765 in which the use associated symbol
3 ! 'fun' was confused with the contained function in 'mod_b'
4 ! because the real name was being used instead of the 'use'
5 ! name..
6 !
7 ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
8 ! from a report by Marco Restelli.
9 !
10 module mod_a
11   implicit none
12   public :: fun
13   private
14 contains
15   pure function fun(x) result(mu)
16     real, intent(in) :: x(:,:)
17     real :: mu(2,2,size(x,2))
18     mu = 2.0
19   end function fun
20 end module mod_a
21
22 module mod_b
23   use mod_a, only: &
24   a_fun => fun
25   implicit none
26   private
27 contains
28   pure function fun(x) result(mu)
29     real, intent(in) :: x(:,:)
30     real :: mu(2,2,size(x,2))
31     mu = a_fun(x)
32   end function fun
33 end module mod_b
34
35 ! { dg-final { cleanup-modules "mod_a mod_b" } }