OSDN Git Service

2009-10-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Oct 2009 03:12:21 +0000 (03:12 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Oct 2009 03:12:21 +0000 (03:12 +0000)
PR libgfortran/35862
* gfortran.dg/round_2.f03: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152484 138bc75d-0d04-0410-961f-82ee72b054a4

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

index e2b31f3..13fbf3d 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