Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / interface_1.f90
blob6a398f1d25b14f6f7da92c10d948ecfb223dafd6
1 ! { dg-do compile }
2 ! This program would segfault without the patch for PR fortran/24005.
3 module y
5 ! If private statement is removed, then we get a bunch of errors
7 private f
9 ! If we rename 'f' in module y to say 'g', then gfortran correctly
10 ! identifies ambiguous as being ambiguous.
12 interface ambiguous
13 module procedure f
14 end interface
16 contains
18 real function f(a)
19 real a
20 f = a
21 end function
23 end module y
25 module z
27 use y
29 interface ambiguous
30 module procedure f ! { dg-error "in generic interface" "" }
31 end interface
33 contains
35 real function f(a)
36 real a
37 f = a
38 end function
40 end module z
42 ! { dg-final { cleanup-modules "y z" } }