aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2007-12-13 12:01:00 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2007-12-13 12:01:00 +0100
commitb446725a8ad50e83d6024dea0fea93a7be60506b (patch)
tree22f6171a6affa88a69cac78b9b3a72aa28c002f0 /gcc
parent014c00953445614f1eabdf244a67f8a086bb3c8c (diff)
downloadgcc-b446725a8ad50e83d6024dea0fea93a7be60506b.zip
gcc-b446725a8ad50e83d6024dea0fea93a7be60506b.tar.gz
gcc-b446725a8ad50e83d6024dea0fea93a7be60506b.tar.bz2
re PR libfortran/34427 (Revision 130708 breaks namelist input)
2007-12-13 Tobias Burnus <burnus@net-b.de> PR fortran/34427 * io/list_read.c (read_real): Fix unwinding for namelists. 2007-12-13 Tobias Burnus <burnus@net-b.de> PR fortran/34427 * gfortran.dg/namelist_42.f90: New. From-SVN: r130889
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_42.f9034
2 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 78f1b06..d665f7d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34427
+ * gfortran.dg/namelist_42.f90: New.
+
2007-12-12 Tobias Burnus <burnus@net-b.de>
PR fortran/34254
diff --git a/gcc/testsuite/gfortran.dg/namelist_42.f90 b/gcc/testsuite/gfortran.dg/namelist_42.f90
new file mode 100644
index 0000000..b0095fe
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_42.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+! { dg-options "-mieee" { target sh*-*-* } }
+!
+! PR fortran/34427
+!
+! Check that namelists and the real values Inf, NaN, Infinity
+! properly coexist.
+!
+ PROGRAM TEST
+ IMPLICIT NONE
+ real , DIMENSION(11) ::foo
+ integer :: infinity
+ NAMELIST /nl/ foo
+ NAMELIST /nl/ infinity
+ foo = -1.0
+ infinity = -1
+
+ open (10, status="scratch")
+! Works:
+ write (10,*) " &nl foo = 5, 5, 5, nan, infinity, infinity "
+ write (10,*)
+ write (10,*) " = 1, /"
+! Does not work
+ !write (10,*) " &nl foo = 5, 5, 5, nan, infinity, infinity"
+ !write (10,*) " = 1, /"
+ rewind (10)
+ READ (10, NML = nl)
+ CLOSE (10)
+
+ if(infinity /= 1) call abort()
+ if(any(foo(1:3) /= [5.0, 5.0, 5.0]) .or. .not.isnan(foo(4)) &
+ .or. foo(5) <= huge(foo) .or. any(foo(6:11) /= -1.0)) &
+ call abort()
+ END PROGRAM TEST