OSDN Git Service

2008-12-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Dec 2008 06:58:38 +0000 (06:58 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Dec 2008 06:58:38 +0000 (06:58 +0000)
PR libfortran/38504
* gfortran.dg/fmt_int_sign.f90: New test.

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

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/fmt_int_sign.f90 [new file with mode: 0644]

index b3a3277..4cd90f0 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/38504
+       * gfortran.dg/fmt_int_sign.f90: New test.
+
 2008-12-13  Sebastian Pop  <sebastian.pop@amd.com>
 
        * gcc.dg/graphite/pr38409.c: Fixed commit problem.
diff --git a/gcc/testsuite/gfortran.dg/fmt_int_sign.f90 b/gcc/testsuite/gfortran.dg/fmt_int_sign.f90
new file mode 100644 (file)
index 0000000..2257fd8
--- /dev/null
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-options -fno-range-check }
+! PR38504 double minus sign when printing integer
+! Test case derived from example by Jos de Kloe
+program IntAdtest
+
+  integer, parameter :: i8_ = Selected_Int_Kind(18)  ! = integer*8
+  character(len=22) :: str_value
+  integer(i8_) :: value
+  character(len=*), parameter :: format_IntAd  = "(i22)"
+
+  value = -9223372036854775807_i8_ -1
+  write(str_value, format_IntAd) value
+  if (str_value.ne."  -9223372036854775808") call abort
+
+end program IntAdtest