2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / module_proc_external_dummy.f90
blob08f61b05f6f3a8486680f697b61d62d245cf5692
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.
8 ! Contributed by Uttam Pawar <uttamp@us.ibm.com>
10 subroutine sub()
11 print *, "external sub"
12 end subroutine sub
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
25 use test_module
26 external sub
27 call sub_module (sub)
28 call sub_module (str)
29 end