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_5.f90] - Blame information for rev 774

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)
13
    IMPLICIT NONE
14
    CHARACTER(len=5) :: str(:) ! Assumed shape.
15
  END SUBROUTINE test
16
 
17
  SUBROUTINE test2 (n)
18
    IMPLICIT NONE
19
    INTEGER :: n
20
    CHARACTER(len=n) :: str(2)
21
    CALL test (str)
22
  END SUBROUTINE test2
23
 
24
END MODULE m
25
 
26
PROGRAM main
27
  USE m
28
  IMPLICIT NONE
29
  CALL test2 (7) ! Too long.
30
END PROGRAM main
31
 
32
! { dg-output "does not match the declared one for dummy argument 'str' \\(7/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.