PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / common_8.f90
blobada4408f5d6c5228f1fb653121baaab09d4e0a6b
1 ! { dg-do compile }
2 ! { dg-options "-std=legacy" }
4 ! PR fortran/25062
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."
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
24 end subroutine try
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