Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / tl_editing.f90
blobd2a7ede436f986560706b722a53931611d128bc2
1 ! { dg-do run }
2 ! Test of fix to bug triggered by NIST fm908.for.
3 ! Left tabbing, followed by X or T-tabbing to the right would
4 ! cause spaces to be overwritten on output data.
5 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
6 ! PR25349 Revised by Jerry DeLisle <jvdelisle@gcc.gnu.org>
7 program tl_editting
8 character*10 :: line, many(5), s
9 character*10 :: aline = "abcdefxyij"
10 character*2 :: bline = "gh"
11 character*10 :: cline = "abcdefghij"
13 ! Character unit test
14 write (line, '(a10,tl6,2x,a2)') aline, bline
15 if (line.ne.cline) call abort ()
17 ! Character array unit test
18 many = "0123456789"
19 write(many(1:5:2), '(a10,tl6,2x,a2)') aline, bline, aline, bline, aline,&
20 &bline
21 if (many(1).ne.cline) call abort ()
22 if (many(3).ne.cline) call abort ()
23 if (many(5).ne.cline) call abort ()
25 ! File unit test
26 write (10, '(a10,tl6,2x,a2)') aline, bline
27 rewind(10)
28 read(10, '(a)') s
29 if (s.ne.cline) call abort
30 close(10, status='delete')
32 end program tl_editting