2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / entry_12.f90
blob5513697a17cd096d759e2d049b67e5d885af43da
1 ! { dg-do run }
2 ! Tests the fix for pr31609, where module procedure entries found
3 ! themselves in the wrong namespace. This test checks that all
4 ! combinations of generic and specific calls work correctly.
6 ! Contributed by Paul Thomas <pault@gcc.gnu.org> as comment #8 to the pr.
8 MODULE ksbin1_aux_mod
9 interface foo
10 module procedure j
11 end interface
12 interface bar
13 module procedure k
14 end interface
15 interface foobar
16 module procedure j, k
17 end interface
18 CONTAINS
19 FUNCTION j ()
20 j = 1
21 return
22 ENTRY k (i)
23 k = 2
24 END FUNCTION j
25 END MODULE ksbin1_aux_mod
27 use ksbin1_aux_mod
28 if (any ((/foo (), bar (99), foobar (), foobar (99), j (), k (99)/) .ne. &
29 (/1, 2, 1, 2, 1, 2/))) Call abort ()
30 end
31 ! { dg-final { cleanup-modules "ksbin1_aux_mod" } }