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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [array_constructor_type_7.f03] - Rev 694

Compare with Previous | Blame | View Log

! { dg-do run }
! { dg-options "-fbounds-check" }
!
! PR fortran/27997
!
! Array constructor with typespec and dynamic
! character length.
!
PROGRAM test
  CALL foo(8, "short", "test", "short")
  CALL foo(2, "lenghty", "te", "le")
CONTAINS
  SUBROUTINE foo (n, s, a1, a2)
    CHARACTER(len=*) :: s
    CHARACTER(len=*) :: a1, a2
    CHARACTER(len=n) :: arr(2)
    INTEGER :: n
    arr = [ character(len=n) :: 'test', s ]
    IF (arr(1) /= a1 .OR. arr(2) /= a2) THEN
      CALL abort ()
    END IF
  END SUBROUTINE foo
END PROGRAM test

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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