c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / ambiguous_reference_1.f90
blob552118fd4f729bf33d0661f4db281dba4f05e2e5
1 ! { dg-do compile }
2 ! Tests the fix for PR33550, in which an ICE would occur, instead of
3 ! the abiguous reference error.
5 ! Found at
6 ! http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/1abc1549a6a164f1/
7 ! by James Van Buskirk:
9 module M1
10 real x
11 end module M1
13 module M2
14 contains
15 subroutine y
16 end subroutine y
17 end module M2
19 module M3
20 use M2, x => y
21 end module M3
23 module M4
24 use M1
25 use M3
26 end module M4
28 module M5
29 use M4 ! 'x' is ambiguous here but is not referred to
30 end module M5
32 module M6
33 use M5 ! ditto
34 end module M6
36 program test
37 use M1
38 use M3
39 interface
40 function x(z) ! { dg-error "ambiguous reference" }
41 end function x ! { dg-error "Expecting END INTERFACE" }
42 end interface
44 write(*,*) 'Hello, world!'
45 end program test
47 function x(z)
48 x = z
49 end function x