gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03
raw| 1 | ! { dg-do run } |
| 2 | ! Test the fix for PR47523 in which concatenations did not work |
| 3 | ! correctly with assignments to deferred character length scalars. |
| 4 | ! |
| 5 | ! Contributed by Thomas Koenig <[email protected]> |
| 6 | ! |
| 7 | program main |
| 8 | implicit none |
| 9 | character(:), allocatable :: a, b |
| 10 | a = 'a' |
| 11 | if (a .ne. 'a') STOP 1 |
| 12 | a = a // 'x' |
| 13 | if (a .ne. 'ax') STOP 2 |
| 14 | if (len (a) .ne. 2) STOP 3 |
| 15 | a = (a(2:2)) |
| 16 | if (a .ne. 'x') STOP 4 |
| 17 | if (len (a) .ne. 1) STOP 5 |
| 18 | end program main |