2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / merge_char_2.f90
blob31ace4b8e16f1e0f192488cae3b0058f799522be
1 ! { dg-do compile }
3 ! See PR fortran/31610
5 implicit none
6 character(len=2) :: a
7 character(len=3) :: b
8 print *, merge(a,a,.true.)
9 print *, merge(a,'aa',.true.)
10 print *, merge('aa',a,.true.)
11 print *, merge('aa','bb',.true.)
12 print *, merge(a, b, .true.) ! { dg-error "Unequal character lengths" }
13 print *, merge(a, 'bbb',.true.) ! { dg-error "Unequal character lengths" }
14 print *, merge('aa',b, .true.) ! { dg-error "Unequal character lengths" }
15 print *, merge('aa','bbb',.true.) ! { dg-error "Unequal character lengths" }
16 end