| 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. |
| 5 |
! |
| 6 |
! Contributed by Bo Berggren <[email protected]> |
| 7 |
! |
| 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) |
| 14 |
|
| 15 |
s1 = 'ABCDEFGHIJK' |
| 16 |
ia = TRANSFER (s1, (/ 0_4 /)) |
| 17 |
s2 = TRANSFER(ba + 32_1, s2) |
| 18 |
|
| 19 |
if (s2 .ne. 'abcdefghijk') STOP 1 |
| 20 |
|
| 21 |
s1 = 'AB' |
| 22 |
ba = TRANSFER (trim (s1)//' JK' , (/ 0_1 /)) |
| 23 |
s2 = TRANSFER(ia, s2) |
| 24 |
|
| 25 |
if (trim (s1)//' JK' .ne. s2) STOP 2 |
| 26 |
|
| 27 |
end program trf_test |