aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2011-02-19 15:31:15 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2011-02-19 15:31:15 +0000
commitf9576cc5862b1a19a750f630714d6ce785119839 (patch)
tree8b0087bd2d42f3599a6b80317f9b96ad530aef0d /gcc/testsuite
parent66115309bba150da328bafb196fa93284e54e411 (diff)
downloadgcc-f9576cc5862b1a19a750f630714d6ce785119839.zip
gcc-f9576cc5862b1a19a750f630714d6ce785119839.tar.gz
gcc-f9576cc5862b1a19a750f630714d6ce785119839.tar.bz2
2011-02-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de> * lib/target-supports.exp (check_effective_target_fortran_large_real): New check for large reals. * gfortran.dg/nan_7.f90: New test. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r170320
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/nan_7.f9015
-rw-r--r--gcc/testsuite/lib/target-supports.exp16
3 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fd5066b..ccdea7f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,4 +1,11 @@
2011-02-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ Tobias Burnus <burnus@net-b.de>
+
+ * lib/target-supports.exp
+ (check_effective_target_fortran_large_real): New check for large reals.
+ * gfortran.dg/nan_7.f90: New test.
+
+2011-02-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/47567
* gfortran.dg/fmt_f0_1.f90: Update test.
diff --git a/gcc/testsuite/gfortran.dg/nan_7.f90 b/gcc/testsuite/gfortran.dg/nan_7.f90
new file mode 100644
index 0000000..12c7b3c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/nan_7.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! { dg-options "-fno-range-check" }
+! { dg-require-effective-target fortran_real_16 }
+! { dg-require-effective-target fortran_integer_16 }
+! PR47293 NAN not correctly read
+character(len=200) :: str
+real(16) :: r
+integer(16) :: k2
+integer(16), parameter :: quietnan = 170099645085600953110659059745250344960
+r = 1.0
+str = 'NAN' ; read(str,*) r
+k2 = transfer(r,k2)
+k2 = iand(k2, z'fff80000000000000000000000000000')
+if (k2.ne.quietnan) call abort
+end
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 02cb7ac..36cab54 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -956,6 +956,22 @@ proc check_effective_target_fortran_large_real { } {
}]
}
+# Return 1 if the target supports Fortran real kind real(16),
+# 0 otherwise. Contrary to check_effective_target_fortran_large_real
+# this checks for Real(16) only; the other returned real(10) if
+# both real(10) and real(16) are available.
+#
+# When the target name changes, replace the cached result.
+
+proc check_effective_target_fortran_real_16 { } {
+ return [check_no_compiler_messages fortran_real_16 executable {
+ ! Fortran
+ real(kind=16) :: x
+ x = cos (x)
+ end
+ }]
+}
+
# Return 1 if the target supports Fortran integer kinds larger than
# integer(8), 0 otherwise.
#