OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [bounds_check_strlen_2.f90] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-fbounds-check" }
3
! { dg-shouldfail "Character length mismatch" }
4
 
5
! PR fortran/37746
6
! Test bounds-checking for string length of dummy arguments.
7
 
8
MODULE m
9
 
10
CONTAINS
11
 
12
  SUBROUTINE test (str, n)
13
    IMPLICIT NONE
14
    CHARACTER(len=n) :: str
15
    INTEGER :: n
16
  END SUBROUTINE test
17
 
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
23
 
24
END MODULE m
25
 
26
PROGRAM main
27
  USE m
28
  IMPLICIT NONE
29
  CALL test2 ('abc') ! String is too short.
30
END PROGRAM main
31
 
32
! { dg-output "shorter than the declared one for dummy argument 'str' \\(3/5\\)" }
33
! { dg-final { cleanup-modules "m" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.