re PR fortran/59700 (Misleading/buggy runtime error message: Bad integer for item...
authorSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 11 Jan 2014 21:38:30 +0000 (21:38 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 11 Jan 2014 21:38:30 +0000 (21:38 +0000)
2014-01-11  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/59700
* gfortran.dg/pr59700.f90: New test.

From-SVN: r206559

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr59700.f90 [new file with mode: 0644]

index c95790fd828c3cbb308760c1fa004854b4fea268..3f33d768703c41fa3c76d1d504e8dfca5f803162 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-11  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/59700
+       * gfortran.dg/pr59700.f90: New test.
+
 2014-01-11  Dominique d'Humieres  <dominiq@lps.ens.fr>
 
        * gfortran.dg/binding_label_tests_10_main.f03: Cleanup mod file.
diff --git a/gcc/testsuite/gfortran.dg/pr59700.f90 b/gcc/testsuite/gfortran.dg/pr59700.f90
new file mode 100644 (file)
index 0000000..579d8a4
--- /dev/null
@@ -0,0 +1,40 @@
+! { dg-do run }
+! PR59700 Test case by Steve Kargl
+program foo
+
+   implicit none
+
+   character(len=80) msg
+   integer, parameter :: fd = 10
+   integer i1, i2, i3, i4
+   real    x1, x2, x3, x4
+   complex c1, c2
+   logical a
+
+   open(unit=fd, status='scratch')
+   write(fd, '(A)') '1 2 3.4 q'
+
+   rewind(fd)
+   msg = 'ok'
+   read(fd, *, err=10, iomsg=msg) i1, i2, i3, i4
+10 if (msg /= 'Bad integer for item 3 in list input') call abort
+   rewind(fd)
+   msg = 'ok'
+   read(fd, *, err=20, iomsg=msg) x1, x2, x3, x4
+20 if (msg /= 'Bad real number in item 4 of list input') call abort
+   rewind(fd)
+   msg = 'ok'
+   read(fd, *, err=30, iomsg=msg) i1, x2, x1, a
+30 if (msg /= 'Bad logical value while reading item 4') call abort
+   rewind(fd)
+   read(fd, *, err=31, iomsg=msg) i1, x2, a, x1
+31 if (msg /= 'Bad repeat count in item 3 of list input') call abort
+   close(fd)
+   open(unit=fd, status='scratch')
+   write(fd, '(A)') '(1, 2) (3.4, q)'
+   rewind(fd)
+   msg = 'ok'
+   read(fd, *, err=40, iomsg=msg) c1, c2
+40 if (msg /= 'Bad floating point number for item 2') call abort
+   close(fd)
+end program foo