Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / transfer_array_intrinsic_4.f90
blob3a929a81446a38f3cfa4d2f0b054a0b6c2418c1a
1 ! { dg-do run }
2 ! { dg-options "-std=gnu" }
3 ! Tests patch for pr27155, where character scalar string_lengths
4 ! were not correctly translated by the array transfer intrinsic.
6 ! Contributed by Bo Berggren <bo.berggren@glocalnet.net>
8 program trf_test
9 implicit none
10 character(11) :: s1, s2
11 integer(4) :: ia(3)
12 integer(1) :: ba(12)
13 equivalence (ia, ba)
15 s1 = 'ABCDEFGHIJK'
16 ia = TRANSFER (s1, (/ 0_4 /))
17 s2 = TRANSFER(ba + 32_1, s2)
19 if (s2 .ne. 'abcdefghijk') call abort ()
21 s1 = 'AB'
22 ba = TRANSFER (trim (s1)//' JK' , (/ 0_1 /))
23 s2 = TRANSFER(ia, s2)
25 if (trim (s1)//' JK' .ne. s2) call abort ()
27 end program trf_test