re PR libfortran/35862 ([F2003] Implement new rounding modes for run time)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 6 Oct 2009 03:12:21 +0000 (03:12 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 6 Oct 2009 03:12:21 +0000 (03:12 +0000)
2009-10-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/35862
* gfortran.dg/round_2.f03: New test.

From-SVN: r152484

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/round_2.f03 [new file with mode: 0644]

index e2b31f38513941da45c0172f886d5b462eb7b8b1..13fbf3d7b846d2039d1249d03d4c38bdeef4fea9 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/35862
+       * gfortran.dg/round_2.f03: New test.
+
 2009-10-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/41558
diff --git a/gcc/testsuite/gfortran.dg/round_2.f03 b/gcc/testsuite/gfortran.dg/round_2.f03
new file mode 100644 (file)
index 0000000..f48ccaa
--- /dev/null
@@ -0,0 +1,16 @@
+! { dg-do run }
+! PR35962 Implement F2003 rounding modes.
+! Test case prepared by Jerry Delisle  <jvdelisle@gcc.gnu.org>
+character(64) :: line
+write(line, '(RN, 4F10.3)') 0.0625_10, 0.1875_10
+if (line.ne."     0.062     0.188") call abort
+
+write(line, '(RN, 4F10.2)') 0.125_10, 0.375_10, 1.125_10, 1.375_10
+if (line.ne."      0.12      0.38      1.12      1.38") call abort
+
+write(line, '(RN, 4F10.1)') 0.25_10, 0.75_10, 1.25_10, 1.75_10
+if (line.ne."       0.2       0.8       1.2       1.8") call abort
+
+write(line, '(RN, 4F10.0)') 0.5_10, 1.5_10, 2.5_10, 3.5_10
+if (line.ne."        0.        2.        2.        4.") call abort
+end