strlen: Fix up !si->full_string_p handling in count_nonzero_bytes_addr [PR115152]
[official-gcc.git] / gcc / testsuite / gfortran.dg / deferred_character_assignment_1.f90
blob888fd56ec251ac94b5187ae8d691e98cd2f0cc33
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) STOP 1
14 if (trim (z) .ne. '') STOP 2
15 z(:3) = "foo"
16 if (len(z) .ne. length) STOP 3
17 if (trim (z) .ne. "foo") STOP 4
18 z(4:) = "__bar"
19 if (len(z) .ne. length) STOP 5
20 if (trim (z) .ne. "foo__bar") STOP 6
21 deallocate (z)
22 end