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>
4!
5program complex_read
6  complex            ::  a
7  open (10, status="scratch")
8
9! Test that we have not broken the one line form.
10
11  write (10, *) " ( 0.99  ,  9.9  )"
12  rewind (10)
13  read (10,*) a
14  if (a.ne.(0.99, 9.90)) call abort ()
15
16! Test a new record after the.comma (the original bug).
17
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 ()
24
25! Test a new record before the.comma
26
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 ()
33
34! Test a new records before and after the.comma
35
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 ()
43
44! Test a new records and blank records before and after the.comma
45
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 ()
55
56  close (10)
57end program complex_read
58
59