OSDN Git Service

2008-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / module_proc_external_dummy.f90
1 ! { dg-do compile }
2 ! This tests the fix for PR24866 in which the reference to the external str, in
3 ! sub_module, would get mixed up with the module procedure, str, thus
4 ! causing an ICE.  This is a completed version of the reporter's testcase; ie
5 ! it adds a main program and working subroutines to allow a check for
6 ! correct functioning.
7 !
8 ! Contributed by Uttam Pawar  <uttamp@us.ibm.com>
9 !
10    subroutine sub()
11      print *, "external sub"
12    end subroutine sub
13
14 module test_module
15  contains
16    subroutine sub_module(str)
17      external :: str
18      call str ()
19    end subroutine sub_module
20    subroutine str()
21      print *, "module str"
22    end subroutine str
23 end module test_module
24
25    use test_module
26    external sub
27    call sub_module (sub)
28    call sub_module (str)
29 end
30 ! { dg-final { cleanup-modules "test_module" } }