OSDN Git Service

Fix PR42186.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / generic_5.f90
1 ! { dg-do compile }
2 ! Tests the patch for PR28201, in which the call to ice would cause an ICE
3 ! because resolve.c(resolve_generic_s) would try to look in the parent
4 ! namespace to see if the subroutine was part of a legal generic interface.
5 ! In this case, there is nothing to test, hence the ICE.
6 !
7 ! Contributed by Daniel Franke  <franke.daniel@gmail.com>
8 !
9 !
10 MODULE ice_gfortran
11   INTERFACE ice
12     MODULE PROCEDURE ice_i
13   END INTERFACE
14
15 CONTAINS
16   SUBROUTINE ice_i(i)
17     INTEGER, INTENT(IN) :: i
18     ! do nothing
19   END SUBROUTINE
20 END MODULE
21
22 MODULE provoke_ice
23 CONTAINS
24   SUBROUTINE provoke
25     USE ice_gfortran
26     CALL ice(23.0)   ! { dg-error "no specific subroutine" }
27   END SUBROUTINE
28 END MODULE
29 ! { dg-final { cleanup-modules "ice_gfortran provoke_ice" } }