2 ! { dg-options "-fbounds-check" }
3 ! { dg-shouldfail "Character length mismatch" }
6 ! Test bounds-checking for string length of dummy arguments.
12 SUBROUTINE test (str, n)
14 CHARACTER(len=n) :: str
18 SUBROUTINE test2 (str)
20 CHARACTER(len=*) :: str
21 CALL test (str, 5) ! Expected length of str is 5.
29 CALL test2 ('abc') ! String is too short.
32 ! { dg-output "shorter than the declared one for dummy argument 'str' \\(3/5\\)" }
33 ! { dg-final { cleanup-modules "m" } }