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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [restricted_expression_3.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 compile }
2
 
3
! PR fortran/35723
4
! Check that a dummy-argument array with non-restricted subscript is
5
! rejected and some more reference-checks.
6
 
7
PROGRAM main
8
  IMPLICIT NONE
9
  CALL test (5, (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), "0123456789" )
10
 
11
CONTAINS
12
 
13
  SUBROUTINE test (n, arr, str)
14
    IMPLICIT NONE
15
    INTEGER :: n, arr(:)
16
    CHARACTER(len=10) :: str
17
 
18
    INTEGER :: i = 5
19
    INTEGER :: ok1(arr(n)), ok2(LEN_TRIM (str(3:n)))
20
    INTEGER :: ok3(LEN_TRIM("hello, world!"(2:n)))
21
    INTEGER :: wrong1(arr(i)) ! { dg-error "'i' cannot appear" }
22
    INTEGER :: wrong2(LEN_TRIM (str(i:n))) ! { dg-error "'i' cannot appear" }
23
    INTEGER :: wrong3(LEN_TRIM ("hello, world!"(i:n))) ! { dg-error "'i' cannot appear" }
24
  END SUBROUTINE test
25
 
26
END PROGRAM main

powered by: WebSVN 2.1.0

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