aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/use_rename_8.f90
blob: b8b49d7a0525e06579b4aed42ca606b22a86dce8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
! { dg-do compile }
!
! PR fortran/63744
! duplicate use rename used to be rejected when the target name
! was that of the current program unit 
!
! Original testcase from Roger Ferrer Ibanez <roger.ferrer@bsc.es>

MODULE MOO
    INTEGER :: A, B, C, D, E, F, G, H, I
END MODULE MOO

SUBROUTINE S
    USE MOO, ONLY: X => A, X => A
END SUBROUTINE S

SUBROUTINE T
    USE MOO, ONLY: X => B
    USE MOO, ONLY: X => B
END SUBROUTINE T

SUBROUTINE C          ! { dg-error "\(1\)" }
    USE MOO, ONLY: C  ! { dg-error "conflicts with the" }
END SUBROUTINE C

SUBROUTINE D
    USE MOO, ONLY: X => D
END SUBROUTINE D

SUBROUTINE E
    USE MOO, ONLY: X => E, X => E
END SUBROUTINE E

SUBROUTINE F
    USE MOO, ONLY: X => F
    USE MOO, ONLY: X => F
END SUBROUTINE F

SUBROUTINE X              ! { dg-error "\(1\)" }
    USE MOO, ONLY: X => G ! { dg-error "conflicts with the rename" }
END SUBROUTINE X

SUBROUTINE Y              ! { dg-error "\(1\)" }
    USE MOO, ONLY: Y => H ! { dg-error "conflicts with the rename" }
END SUBROUTINE Y

SUBROUTINE Z                        ! { dg-error "\(1\)" }
    USE MOO, ONLY: Z => I, Z => I   ! { dg-error "conflicts with the rename" }
END SUBROUTINE Z