diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03')
-rw-r--r-- | gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03 b/gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03 new file mode 100644 index 000000000..db4233d5f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03 @@ -0,0 +1,18 @@ +! { dg-do run } +! Test the fix for PR47523 in which concatenations did not work +! correctly with assignments to deferred character length scalars. +! +! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org> +! +program main + implicit none + character(:), allocatable :: a, b + a = 'a' + if (a .ne. 'a') call abort + a = a // 'x' + if (a .ne. 'ax') call abort + if (len (a) .ne. 2) call abort + a = (a(2:2)) + if (a .ne. 'x') call abort + if (len (a) .ne. 1) call abort +end program main |