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