Retro68/gcc/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_5.f90
2017-04-10 13:32:00 +02:00

11 lines
308 B
Fortran

! { dg-do compile }
!
! PR 36112
! Check correct bounds-checking behavior for character-array-constructors.
! No need for -fbounds-check, enabled unconditionally.
character(len=5) :: s = "hello"
character(len=128) :: arr(3)
arr = (/ "abc", "foo", s /) ! { dg-error "Different CHARACTER lengths" }
end