re PR fortran/32770 ([Meta-bug] -fdefault-integer-8 issues)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 20 Nov 2007 21:57:04 +0000 (21:57 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 20 Nov 2007 21:57:04 +0000 (21:57 +0000)
2007-11-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/32770
* gfortran.dg/record_marker_1.f90:  Explicitly set kinds
so test passes with -frecord-marker=8.
* gfortran.dg/integer_exponentiation_1.f90:  Likewise.
* gfortran.dg/integer_exponentiation_2.f90:  Likewise.
* gfortran.dg/integer_exponentiation_3.F90:  Likewise.
* gfortran.dg/integer_exponentiation_5.F90:  Likewise.
* gfortrand.dg/modulo_1.f90:  Likewise.

From-SVN: r130322

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/integer_exponentiation_1.f90
gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90
gcc/testsuite/gfortran.dg/integer_exponentiation_3.F90
gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90
gcc/testsuite/gfortran.dg/modulo_1.f90
gcc/testsuite/gfortran.dg/record_marker_1.f90

index fc6f774ea2d63805c78359a6331ff67b288e44b5..bd293d102283c91982c8aad623760c0723f4133b 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/32770
+       * gfortran.dg/record_marker_1.f90:  Explicitly set kinds
+       so test passes with -frecord-marker=8.
+       * gfortran.dg/integer_exponentiation_1.f90:  Likewise.
+       * gfortran.dg/integer_exponentiation_2.f90:  Likewise.
+       * gfortran.dg/integer_exponentiation_3.F90:  Likewise.
+       * gfortran.dg/integer_exponentiation_5.F90:  Likewise.
+       * gfortrand.dg/modulo_1.f90:  Likewise.
+
 2007-11-20  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * lib/target-supports.exp (check_effective_target_mips_soft_float):
index 57d7466d0050efe20dce52e675bb39775c511f2f..bed7c6ab02a34383f5aabb6d23d25d8e81134224 100644 (file)
@@ -2,5 +2,5 @@
 ! PR 30981 - this used to go into an endless loop during execution.
 program test
   a = 3.0
-  b = a**(-2147483647-1) ! { dg-warning "Integer outside symmetric range" }
+  b = a**(-2147483647_4-1_4) ! { dg-warning "Integer outside symmetric range" }
 end program test
index 4701cea7927159ab026e0b1abdb2b131702cdaae..55d00ba28b87d65dec2ad0cef10ecf1560eee091 100644 (file)
@@ -22,10 +22,11 @@ subroutine run_me(a, i, z)
   call check_equal_i (i**2, i*i)
   call check_equal_i (i**3, i*(i**2))
 
-  call check_equal_i (int(i**0_8,kind=4), 1)
-  call check_equal_i (int(i**1_8,kind=4), i)
-  call check_equal_i (int(i**2_8,kind=4), i*i)
-  call check_equal_i (int(i**3_8,kind=4), i*i*i)
+  ! i has default integer kind.
+  call check_equal_i (int(i**0_8,kind=kind(i)), 1)
+  call check_equal_i (int(i**1_8,kind=kind(i)), i)
+  call check_equal_i (int(i**2_8,kind=kind(i)), i*i)
+  call check_equal_i (int(i**3_8,kind=kind(i)), i*i*i)
 
   call check_equal_r (a**0.0, 1.0)
   call check_equal_r (a**1.0, a)
index da75dbaa3830f4089216343cb20045ec275f53fe..3d95fb102cc8245c4ee5ead0a4bb9aa5aecece71 100644 (file)
@@ -82,9 +82,9 @@ program test
   TEST(1_8,0_8,i8)
   TEST(-1,0,i4)
   TEST(-1_8,0_8,i8)
-  TEST(huge(0),0,i4)
+  TEST(huge(0_4),0,i4)
   TEST(huge(0_8),0_8,i8)
-  TEST(-huge(0)-1,0,i4)
+  TEST(-huge(0_4)-1,0,i4)
   TEST(-huge(0_8)-1_8,0_8,i8)
 
   TEST(1,1,i4)
@@ -164,7 +164,7 @@ program test
   TEST(2.0,-3_8,r4)
 
   TEST(nearest(1.0,-1.0),0,r4)
-  TEST(nearest(1.0,-1.0),huge(0),r4) ! { dg-warning "Arithmetic underflow" }
+  TEST(nearest(1.0,-1.0),huge(0_4),r4) ! { dg-warning "Arithmetic underflow" }
   TEST(nearest(1.0,-1.0),0_8,r4)
   TEST(nearest(1.0_8,-1.0),huge(0_8),r8) ! { dg-warning "Arithmetic underflow" }
 
index 52410f8f5e6d71d779930c78a5d917bc9e23c843..07127c6aa4e61549425a1038e0bb7c0a6c86633c 100644 (file)
@@ -65,7 +65,7 @@ program test
   TEST(3_8,43_8,i8)
   TEST(-3_8,43_8,i8)
 
-  TEST(17_8,int(huge(0),kind=8)+1,i8)
+  TEST(17_8,int(huge(0_4),kind=8)+1,i8)
 
 !!!!! REAL BASE !!!!!
   TEST(0.0,-1,r4)
index 6fb05093d9e3ce235764ad92a2cda9cebd8124c7..52c3b0966b74c03e1110f0e40ae77ca94e53e8d7 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! PR fortran/23912
-  integer i4
+  integer(kind=4) i4
   integer(kind=8) i8
 
   i4 = modulo(i4,i8) ! { dg-warning "Extension" }
index 8312171d474b7389b7230b271cfe303fabc09b55..5bcfbc611a5fdd3b7fd6620bd705218c0d3450ee 100644 (file)
@@ -3,36 +3,36 @@
 
 program main
   implicit none
-  integer :: i1, i2, i3
+  integer(kind=4) :: i1, i2, i3
 
   open(15,form="UNFORMATTED")
-  write (15) 1
+  write (15) 1_4
   close (15)
   open (15,form="UNFORMATTED",access="DIRECT",recl=4)
-  i1 = 1
-  i2 = 2
-  i3 = 3
+  i1 = 1_4
+  i2 = 2_4
+  i3 = 3_4
   read (15,rec=1) i1
   read (15,rec=2) i2
   read (15,rec=3) i3
   close (15, status="DELETE")
-  if (i1 /= 4) call abort
-  if (i2 /= 1) call abort
-  if (i3 /= 4) call abort
+  if (i1 /= 4_4) call abort
+  if (i2 /= 1_4) call abort
+  if (i3 /= 4_4) call abort
 
   open(15,form="UNFORMATTED",convert="SWAP")
-  write (15) 1
+  write (15) 1_4
   close (15)
   open (15,form="UNFORMATTED",access="DIRECT",convert="SWAP",recl=4)
-  i1 = 1
-  i2 = 2
-  i3 = 3
+  i1 = 1_4
+  i2 = 2_4
+  i3 = 3_4
   read (15,rec=1) i1
   read (15,rec=2) i2
   read (15,rec=3) i3
   close(15,status="DELETE")
-  if (i1 /= 4) call abort
-  if (i2 /= 1) call abort
-  if (i3 /= 4) call abort
+  if (i1 /= 4_4) call abort
+  if (i2 /= 1_4) call abort
+  if (i3 /= 4_4) call abort
 
 end program main