URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [array_constructor_type_10.f03] - Rev 312
Go to most recent revision | 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", "short")
CALL foo(2, "lenghty", "le")
CONTAINS
SUBROUTINE foo (n, s, shouldBe)
CHARACTER(len=*) :: s
CHARACTER(len=*) :: shouldBe
CHARACTER(len=16) :: arr(2)
INTEGER :: n
arr = [ character(len=n) :: s, s ]
IF (arr(1) /= shouldBe .OR. arr(2) /= shouldBe) THEN
CALL abort ()
END IF
END SUBROUTINE foo
END PROGRAM test
Go to most recent revision | Compare with Previous | Blame | View Log