aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/read_float_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/read_float_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/read_float_1.f9012
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/read_float_1.f90 b/gcc/testsuite/gfortran.dg/read_float_1.f90
new file mode 100644
index 00000000000..e38036f8b92
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/read_float_1.f90
@@ -0,0 +1,12 @@
+! { dg-do run }
+! PR18218
+! The IO library has an algorithm that involved repeated multiplication by 10,
+! resulting in introducing large cumulative floating point errors.
+program foo
+ character*20 s
+ real*8 d
+ s = "-.18774312893273 "
+ read(unit=s, fmt='(g20.14)') d
+ if (d + 0.18774312893273d0 .gt. 1d-13) call abort
+end program
+