summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-13 18:43:14 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-13 18:43:14 +0000
commit75e6d81bbefb95382686bbac5de58bbb3cdb6017 (patch)
tree1c28fb5dafb8fc2f620f979446e0d67d6873cd05 /gcc
parent3e3a0a79c6d4fd4ce136737047f8bad349639526 (diff)
downloadlinaro-gcc-75e6d81bbefb95382686bbac5de58bbb3cdb6017.tar.gz
linaro-gcc-75e6d81bbefb95382686bbac5de58bbb3cdb6017.tar.bz2
linaro-gcc-75e6d81bbefb95382686bbac5de58bbb3cdb6017.zip
2005-07-13 Paul Thomas <pault@gcc.gnu.org>
* io/read.c (read_complex): Prevent X formatting during reads from going beyond EOR to fix NIST fm908.FOR failure. * io/list_read.c (read_complex): Allow complex data in list- directed reads to have eols either side of the comma to fix NIST FM906.FOR failure. 2005-07-13 Paul Thomas <pault@gcc.gnu.org> * gfortran.dg/past_eor.f90: New. * gfortran.dg/complex_read.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101984 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gfortran.dg/complex_read.f9058
-rw-r--r--gcc/testsuite/gfortran.dg/past_eor.f9022
3 files changed, 83 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3f187ae65b2..9b305504628 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,9 +1,7 @@
-2005-07-13 Jeff Law <law@redhat.com>
+2005-07-13 Paul Thomas <pault@gcc.gnu.org>
- * gcc.dg/tree-ssa/pr22051-2.c: Tweak expected output to allow
- additional casts.
-
- * gcc.dg/tree-ssa/pr22321.c: New test
+ * gfortran.dg/past_eor.f90: New.
+ * gfortran.dg/complex_read.f90: New.
2005-07-13 Paolo Bonzini <bonzini@gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/complex_read.f90 b/gcc/testsuite/gfortran.dg/complex_read.f90
new file mode 100644
index 00000000000..c12b66c5b43
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/complex_read.f90
@@ -0,0 +1,58 @@
+! { dg-do run }
+! Test of the fix to the bug in NIST fm906.for.
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+program complex_read
+ complex :: a
+ open (10, status="scratch")
+
+! Test that we have not broken the one line form.
+
+ write (10, *) " ( 0.99 , 9.9 )"
+ rewind (10)
+ read (10,*) a
+ if (a.ne.(0.99, 9.90)) call abort ()
+
+! Test a new record after the.comma (the original bug).
+
+ rewind (10)
+ write (10, *) " ( 99.0 ,"
+ write (10, *) " 999.0 )"
+ rewind (10)
+ read (10,*) a
+ if (a.ne.(99.0, 999.0)) call abort ()
+
+! Test a new record before the.comma
+
+ rewind (10)
+ write (10, *) " ( 0.99 "
+ write (10, *) " , 9.9 )"
+ rewind (10)
+ read (10,*) a
+ if (a.ne.(0.99, 9.90)) call abort ()
+
+! Test a new records before and after the.comma
+
+ rewind (10)
+ write (10, *) " ( 99.0 "
+ write (10, *) ", "
+ write (10, *) " 999.0 )"
+ rewind (10)
+ read (10,*) a
+ if (a.ne.(99.0, 999.0)) call abort ()
+
+! Test a new records and blank records before and after the.comma
+
+ rewind (10)
+ write (10, *) " ( 0.99 "
+ write (10, *) " "
+ write (10, *) ", "
+ write (10, *) " "
+ write (10, *) " 9.9 )"
+ rewind (10)
+ read (10,*) a
+ if (a.ne.(0.99, 9.9)) call abort ()
+
+ close (10)
+end program complex_read
+
diff --git a/gcc/testsuite/gfortran.dg/past_eor.f90 b/gcc/testsuite/gfortran.dg/past_eor.f90
new file mode 100644
index 00000000000..e89ed227266
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/past_eor.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! Test of the fix to the bug triggered by NIST fm908.for.
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+program past_eor
+ character(len=82) :: buffer
+ real :: a(2), b(2), c(2), d(2), e(2)
+
+ e = (/2.34,2.456/)
+
+! tests 28-31 from fm908.for
+
+ buffer = ' 2.34 , 2.456 2.34 , 2.456 0.234E01, 2.456E00&
+ & 0.234E+001, 2.456E-000'
+
+ READ (UNIT=buffer,FMT=10) a, b, c, d
+10 FORMAT (2(2(G7.5,1X),2X),2(G10.4E2,1X),1X,2(G11.7E4,1X))
+
+ if (any (a.ne.e).or.any (b.ne.e).or.any (c.ne.e).or.any (d.ne.e)) call abort ()
+
+end program past_eor
+