2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / select_type_41.f90
blobeebb87922bd43e4210b4232feb5ea0eb9bf23eda
1 ! { dg-do compile }
2 ! { dg-options "-O2" }
4 ! Tests the fix for PR80965 in which the use of the name 'loc'
5 ! for the dummy argument of 'xyz' caused an ICE. If the module
6 ! was used, the error "DUMMY attribute conflicts with INTRINSIC
7 ! attribute in ‘loc’ at (1)" was emitted. Note that although 'loc'
8 ! is a GNU extension and so can be over-ridden, this is not very
9 ! good practice.
11 ! Contributed by David Sagan <david.sagan@gmail.com>
13 module mode3_mod
14 contains
15 subroutine xyz (loc)
16 implicit none
17 class(*) :: loc
18 real x(6)
19 integer ix_use
20 select type (loc)
21 type is (integer)
22 x = 0
23 print *, "integer"
24 type is (real)
25 ix_use = 0
26 print *, "real"
27 end select
28 end subroutine xyz
29 end module mode3_mod