re PR libfortran/89274 (Inconsistent list directed output of INTEGER(16))
authorDominique d'Humieres <dominiq@gcc.gnu.org>
Mon, 25 Feb 2019 10:39:38 +0000 (11:39 +0100)
committerDominique d'Humieres <dominiq@gcc.gnu.org>
Mon, 25 Feb 2019 10:39:38 +0000 (11:39 +0100)
2019-02-25  Dominique d'Humieres  <dominiq@gcc.gnu.org>

PR libfortran/89274
* gfortran.dg/list_directed_large.f90: New test.

2019-02-25  Dominique d'Humieres  <dominiq@gcc.gnu.org>

PR libfortran/89274
* io/write.c (write_integer): Add width for INTEGER(16).

From-SVN: r269187

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/list_directed_large.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/write.c

index 70e692bcec775b58e35414a4c2309b77ee05c7c2..bbe27aa83a6e3919960b38be699b6612cbcb7d6f 100644 (file)
@@ -1,3 +1,8 @@
+2019-02-25  Dominique d'Humieres  <dominiq@gcc.gnu.org>
+
+       PR libfortran/89274
+       * gfortran.dg/list_directed_large.f90: New test. 
+
 2019-02-25  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/89434
diff --git a/gcc/testsuite/gfortran.dg/list_directed_large.f90 b/gcc/testsuite/gfortran.dg/list_directed_large.f90
new file mode 100644 (file)
index 0000000..ab631d7
--- /dev/null
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-require-effective-target fortran_large_int }
+! PR libfortran/89274 Inconsistent list directed output of INTEGER(16)
+!
+integer(16) :: j(2)
+character(82) :: str
+j = huge(1_16)
+write(str,*) j
+if (str /= "  170141183460469231731687303715884105727  170141183460469231731687303715884105727") stop 1
+j = 1
+write(str,*) j
+if (str /= "                                        1                                        1") stop 2
+j = -huge(1_16)
+write(str,*) j
+if (str /= " -170141183460469231731687303715884105727 -170141183460469231731687303715884105727") stop 3
+end
index d0a3962ba29aad6c92a0a9a32b4c4bffd56b56be..0941b5876fd9975d078f93452bd3fdc974976b6d 100644 (file)
@@ -1,3 +1,8 @@
+2019-02-25  Dominique d'Humieres  <dominiq@gcc.gnu.org>
+
+       PR libfortran/89274
+       * io/write.c (write_integer): Add width for INTEGER(16).
+
 2019-02-23  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/89385
index 449b35ff4c85b946be40b5e7a68fca8994717442..c8811e200e0d86e4ca952ba995f18acdb1595cb3 100644 (file)
@@ -1342,6 +1342,10 @@ write_integer (st_parameter_dt *dtp, const char *source, int kind)
       width = 20;
       break;
 
+    case 16:
+      width = 40;
+      break;
+
     default:
       width = 0;
       break;