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_6.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-fbounds-check" }
3
 
4
! PR fortran/37746
5
! Ensure that too long or matching string lengths don't trigger the runtime
6
! error for matching string lengths, if the dummy argument is neither
7
! POINTER nor ALLOCATABLE or assumed-shape.
8
! Also check that absent OPTIONAL arguments don't trigger the check.
9
 
10
MODULE m
11
CONTAINS
12
 
13
  SUBROUTINE test (str, opt)
14
    IMPLICIT NONE
15
    CHARACTER(len=5) :: str
16
    CHARACTER(len=5), OPTIONAL :: opt
17
  END SUBROUTINE test
18
 
19
END MODULE m
20
 
21
PROGRAM main
22
  USE m
23
  IMPLICIT NONE
24
  CALL test ('abcde')  ! String length matches.
25
  CALL test ('abcdef') ! String too long, is ok.
26
END PROGRAM main
27
 
28
! { 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.