| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-std=legacy" } |
| 3 |
! |
| 4 |
! PR fortran/25062 |
| 5 |
! |
| 6 |
! F2003: 16.2.1 |
| 7 |
! "A name that identifies a common block in a scoping unit shall not be used |
| 8 |
! to identify a constant or an intrinsic procedure in that scoping unit." |
| 9 |
! |
| 10 |
subroutine try |
| 11 |
implicit none |
| 12 |
COMMON /s/ J |
| 13 |
COMMON /bar/ I |
| 14 |
INTEGER I, J |
| 15 |
real s, x |
| 16 |
s(x)=sin(x) |
| 17 |
print *, s(5.0) |
| 18 |
call bar() |
| 19 |
contains |
| 20 |
subroutine bar |
| 21 |
print *, 'Hello world' |
| 22 |
end subroutine bar |
| 23 |
|
| 24 |
end subroutine try |
| 25 |
|
| 26 |
program test |
| 27 |
implicit none |
| 28 |
COMMON /abs/ J ! { dg-error "is also an intrinsic procedure" } |
| 29 |
intrinsic :: abs |
| 30 |
INTEGER J |
| 31 |
external try |
| 32 |
call try |
| 33 |
end program test |