2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / bounds_check_strlen_8.f90
blob7319988968f0b8494bc3051780cbb221efde00da
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
4 ! PR fortran/40383
5 ! Gave before a bogus out of bounds.
6 ! Contributed by Joost VandeVondele.
8 MODULE M1
9 INTEGER, PARAMETER :: default_string_length=80
10 END MODULE M1
11 MODULE M2
12 USE M1
13 IMPLICIT NONE
14 CONTAINS
15 FUNCTION F1(a,b,c,d) RESULT(RES)
16 CHARACTER(LEN=default_string_length), OPTIONAL :: a,b,c,d
17 LOGICAL :: res
18 END FUNCTION F1
19 END MODULE M2
21 MODULE M3
22 USE M1
23 USE M2
24 IMPLICIT NONE
25 CONTAINS
26 SUBROUTINE S1
27 CHARACTER(LEN=default_string_length) :: a,b
28 LOGICAL :: L1
29 INTEGER :: i
30 DO I=1,10
31 L1=F1(a,b)
32 ENDDO
33 END SUBROUTINE
34 END MODULE M3
36 USE M3
37 CALL S1
38 END