view gcc/testsuite/gfortran.dg/merge_char_3.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
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