Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / use_rename_8.f90
blobad3ab3977c5b796f78512b47d96d72510ae4d4b1
1 ! { dg-do compile }
3 ! PR fortran/63744
4 ! duplicate use rename used to be rejected when the target name
5 ! was that of the current program unit
7 ! Original testcase from Roger Ferrer Ibanez <roger.ferrer@bsc.es>
9 MODULE MOO
10 INTEGER :: A, B, C, D, E, F, G, H, I
11 END MODULE MOO
13 SUBROUTINE S
14 USE MOO, ONLY: X => A, X => A
15 END SUBROUTINE S
17 SUBROUTINE T
18 USE MOO, ONLY: X => B
19 USE MOO, ONLY: X => B
20 END SUBROUTINE T
22 SUBROUTINE C
23 USE MOO, ONLY: C ! { dg-error "is also the name of the current program unit" }
24 END SUBROUTINE C
26 SUBROUTINE D
27 USE MOO, ONLY: X => D
28 END SUBROUTINE D
30 SUBROUTINE E
31 USE MOO, ONLY: X => E, X => E
32 END SUBROUTINE E
34 SUBROUTINE F
35 USE MOO, ONLY: X => F
36 USE MOO, ONLY: X => F
37 END SUBROUTINE F
39 SUBROUTINE X
40 USE MOO, ONLY: X => G ! { dg-error "is also the name of the current program unit" }
41 END SUBROUTINE X
43 SUBROUTINE Y
44 USE MOO, ONLY: Y => H ! { dg-error "is also the name of the current program unit" }
45 END SUBROUTINE Y
47 SUBROUTINE Z
48 USE MOO, ONLY: Z => I, Z => I ! { dg-error "is also the name of the current program unit" }
49 END SUBROUTINE Z