fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / merge_char_3.f90
blob498e3ec73c54dc3e0ad35a7cb628fa0546fd6a66
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
3 ! { dg-shouldfail "Unequal character lengths" }
5 ! PR fortran/38137
6 ! Test that -fbounds-check detects unequal character lengths to MERGE
7 ! at runtime.
9 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
11 subroutine foo(a)
12 implicit none
13 character(len=*) :: a
14 character(len=3) :: b
15 print *, merge(a,b,.true.) ! Unequal character lengths
16 end subroutine foo
18 call foo("ab")
19 end