[to-be-committed] [RISC-V] Use Zbkb for general 64 bit constants when profitable
[official-gcc.git] / gcc / testsuite / gfortran.dg / bounds_check_strlen_2.f90
blob73c2ea8282ea76c9ca9260ec3d9a5497f0b1f096
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
3 ! { dg-shouldfail "Character length mismatch" }
5 ! PR fortran/37746
6 ! Test bounds-checking for string length of dummy arguments.
8 MODULE m
10 CONTAINS
12 SUBROUTINE test (str, n)
13 IMPLICIT NONE
14 INTEGER :: n
15 CHARACTER(len=n) :: str
16 END SUBROUTINE test
18 SUBROUTINE test2 (str)
19 IMPLICIT NONE
20 CHARACTER(len=*) :: str
21 CALL test (str, 5) ! Expected length of str is 5.
22 END SUBROUTINE test2
24 END MODULE m
26 PROGRAM main
27 USE m
28 IMPLICIT NONE
29 CALL test2 ('abc') ! String is too short.
30 END PROGRAM main
32 ! { dg-output "shorter than the declared one for dummy argument 'str' \\(3/5\\)" }