view gcc/testsuite/gfortran.dg/merge_char_3.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

! { dg-do run }
! { dg-options "-fbounds-check" }
! { dg-shouldfail "Unequal character lengths" }

! PR fortran/38137
! Test that -fbounds-check detects unequal character lengths to MERGE
! at runtime.

! Contributed by Tobias Burnus <burnus@gcc.gnu.org>

subroutine foo(a)
implicit none
character(len=*) :: a
character(len=3) :: b
logical :: ll = .true.
print *, merge(a,b,ll)  ! Unequal character lengths
end subroutine foo

call foo("ab")
end