[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / substr_2.f
bloba7e43b635e8f3ddfe6a021593899f2fc17de8b7a
1 ! { dg-do run }
2 ! Check that substrings behave correctly even when zero-sized
3 implicit none
4 character(len=10) :: s, t
5 integer :: i, j
7 s = "abcdefghij"
8 t(:10) = s(1:)
9 s(6:5) = "foo"
10 if (s /= t) call abort
11 i = 2
12 j = -1
13 s(i:i+j) = "foo"
14 if (s /= t) call abort
15 i = 20
16 s(i+1:i) = "foo"
17 if (s /= t) call abort
18 s(6:5) = s(7:5)
19 if (s /= t) call abort
20 s = t(7:6)
21 if (len(trim(s)) /= 0) call abort
22 if (len(t(8:4)) /= 0) call abort
23 if (len(trim(t(8:4))) /= 0) call abort
24 end