2009-10-05 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / complex_read.f90
blob102a13522f9d910bcec2119a82f712491802700c
1 ! { dg-do run { target fd_truncate } }
2 ! Test of the fix to the bug in NIST fm906.for.
3 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
5 program complex_read
6 complex :: a
7 open (10, status="scratch")
9 ! Test that we have not broken the one line form.
11 write (10, *) " ( 0.99 , 9.9 )"
12 rewind (10)
13 read (10,*) a
14 if (a.ne.(0.99, 9.90)) call abort ()
16 ! Test a new record after the.comma (the original bug).
18 rewind (10)
19 write (10, *) " ( 99.0 ,"
20 write (10, *) " 999.0 )"
21 rewind (10)
22 read (10,*) a
23 if (a.ne.(99.0, 999.0)) call abort ()
25 ! Test a new record before the.comma
27 rewind (10)
28 write (10, *) " ( 0.99 "
29 write (10, *) " , 9.9 )"
30 rewind (10)
31 read (10,*) a
32 if (a.ne.(0.99, 9.90)) call abort ()
34 ! Test a new records before and after the.comma
36 rewind (10)
37 write (10, *) " ( 99.0 "
38 write (10, *) ", "
39 write (10, *) " 999.0 )"
40 rewind (10)
41 read (10,*) a
42 if (a.ne.(99.0, 999.0)) call abort ()
44 ! Test a new records and blank records before and after the.comma
46 rewind (10)
47 write (10, *) " ( 0.99 "
48 write (10, *) " "
49 write (10, *) ", "
50 write (10, *) " "
51 write (10, *) " 9.9 )"
52 rewind (10)
53 read (10,*) a
54 if (a.ne.(0.99, 9.9)) call abort ()
56 close (10)
57 end program complex_read