2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / fmt_t_2.f90
blobc2b869481df6872f32136de20750b98230661bcf
1 ! { dg-options "" }
2 ! { dg-do run }
3 ! pr24699, handle end-of-record on READ with T format
4 ! test contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
5 character*132 :: foost1, foost2, foost3
6 open (11, status="scratch", action="readwrite")
7 write(11, '(a)') "ab cdefghijkl mnop qrst"
8 write(11, '(a)') "123456789 123456789 123456789"
9 write(11, '(a)') " Now is the time for all good."
10 rewind(11)
12 read (11, '(a040,t1,040a)', end = 999) foost1 , foost2
13 if (foost1.ne.foost2) call abort()
15 read (11, '(a032,t2,a032t3,a032)', end = 999) foost1 , foost2, foost3
16 if (foost1(1:32).ne."123456789 123456789 123456789 ") call abort()
17 if (foost2(1:32).ne."23456789 123456789 123456789 ") call abort()
18 if (foost3(1:32).ne."3456789 123456789 123456789 ") call abort()
20 read (11, '(a017,t1,a0017)', end = 999) foost1 , foost2
21 if (foost1.ne.foost2) call abort()
22 if (foost2(1:17).ne." Now is the time ") call abort()
23 goto 1000
24 999 call abort()
25 1000 continue
26 close(11)
27 end