2 ! This program tests the patch for PRs 20881, 23308, 25538 & 25710
3 ! Assembled from PRs by Paul Thomas <pault@gcc.gnu.org>
6 subroutine g(x
) ! Local entity
11 ! Error only appears once but testsuite associates with both lines.
12 function f(x
) ! { dg-error "is already being used as a FUNCTION" }
17 function g(x
) ! Global entity
21 ! PR25710==========================================================
22 ! Lahey -2607-S: "SOURCE.F90", line 26:
23 ! Function 'f' cannot be referenced as a subroutine. The previous
24 ! definition is in 'line 12'.
26 call f(g
) ! { dg-error "is already being used as a FUNCTION" }
28 ! Error only appears once but testsuite associates with both lines.
29 function h(x
) ! { dg-error "is already being used as a FUNCTION" }
35 CHARACTER(LEN
=10), EXTERNAL :: j
! { dg-error "Return type mismatch" }
36 CHARACTER(LEN
=10) :: T
37 ! PR20881===========================================================
38 ! Error only appears once but testsuite associates with both lines.
39 T
= j (1.0) ! { dg-error "is already being used as a SUBROUTINE" }
47 ! PR23308===========================================================
48 ! Lahey - 2604-S: "SOURCE.F90", line 52:
49 ! The name 'foo' cannot be specified as both external procedure name
50 ! and common block name. The previous appearance is in 'line 68'.
51 ! Error only appears once but testsuite associates with both lines.
52 common /foo
/ a
! { dg-error "is already being used as a COMMON" }
54 call f (x
) ! OK - reference to local entity
57 ! PR25710===========================================================
58 ! Lahey - 2607-S: "SOURCE.F90", line 62:
59 ! Function 'h' cannot be referenced as a subroutine. The previous
60 ! definition is in 'line 29'.
62 call h (x
) ! { dg-error "is already being used as a FUNCTION" }
64 ! PR23308===========================================================
65 ! Lahey - 2521-S: "SOURCE.F90", line 68: Intrinsic procedure name or
66 ! external procedure name same as common block name 'foo'.
68 call foo () ! { dg-error "is already being used as a COMMON" }
71 SUBROUTINE f (x
) ! Local entity
77 ! PR20881===========================================================
78 ! Lahey - 2636-S: "SOURCE.F90", line 81:
79 ! Subroutine 'j' is previously referenced as a function in 'line 39'.
81 SUBROUTINE j (x
) ! { dg-error "is already being used as a SUBROUTINE" }
83 common /bar
/ a
! Global entity foo
85 x
= bar(1.0) ! OK for local procedure to have common block name
93 ! PR25538===========================================================
94 ! would ICE with entry and procedure having same names.
95 subroutine link2 (namef
) ! { dg-error "is already being used as a SUBROUTINE" }
96 entry link2 (nameg
) ! { dg-error "is already being used as a SUBROUTINE" }
100 ! { dg-final { cleanup-modules "m" } }