2015-10-18 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / deferred_character_assignment_1.f90
blobf3a739f503ddeb88dc51f3c333288677a276fcb7
1 ! { dg-do run }
3 ! Checks the fix for PR67977 in which automatic reallocation on assignment
4 ! was performed when the lhs had a substring reference.
6 ! Contributed by Anton Shterenlikht <mexas@bristol.ac.uk>
8 character(:), allocatable :: z
9 integer :: length
10 z = "cockatoo"
11 length = len (z)
12 z(:) = ''
13 if (len(z) .ne. length) call abort
14 if (trim (z) .ne. '') call abort
15 z(:3) = "foo"
16 if (len(z) .ne. length) call abort
17 if (trim (z) .ne. "foo") call abort
18 z(4:) = "__bar"
19 if (len(z) .ne. length) call abort
20 if (trim (z) .ne. "foo__bar") call abort
21 deallocate (z)
22 end