Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/array_constructor_type_10.f03 @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line source
! { 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 STOP 1 END IF END SUBROUTINE foo END PROGRAM test