1! { dg-do run }
2! { dg-options "-std=legacy" }
3!
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>
9program tl_editting
10  character*10           ::  line, many(5), s
11  character*10           ::  aline = "abcdefxyij"
12  character*2            ::  bline = "gh"
13  character*10           ::  cline = "abcdefghij"
14
15! Character unit test
16  write (line, '(a10,tl6,2x,a2)') aline, bline
17  if (line.ne.cline) STOP 1
18
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) STOP 2
24  if (many(3).ne.cline) STOP 3
25  if (many(5).ne.cline) STOP 4
26
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) STOP 1
32  close(10, status='delete')
33
34end program tl_editting
35
36