Fortran: Fix -freal-{4,8}-real* handling [PR99355]
Avoid chain kind conversion for, e.g., -freal-4-real-8 -freal-8-real-10. Note that gfc_default_double_kind/gfc_default_double_kind already honors the -freal flags. gcc/fortran/ChangeLog: PR fortran/99355 * decl.c (gfc_match_old_kind_spec, gfc_match_kind_spec): Avoid redoing kind conversions. * primary.c (match_real_constant): Likewise. gcc/testsuite/ChangeLog: PR fortran/99355 * gfortran.dg/real4-10-real8-10.f90: New test. * gfortran.dg/real4-10-real8-16.f90: New test. * gfortran.dg/real4-10-real8-4.f90: New test. * gfortran.dg/real4-10.f90: New test. * gfortran.dg/real4-16-real8-10.f90: New test. * gfortran.dg/real4-16-real8-16.f90: New test. * gfortran.dg/real4-16-real8-4.f90: New test. * gfortran.dg/real4-16.f90: New test. * gfortran.dg/real4-8-real8-10.f90: New test. * gfortran.dg/real4-8-real8-16.f90: New test. * gfortran.dg/real4-8-real8-4.f90: New test. * gfortran.dg/real4-8.f90: New test. * gfortran.dg/real8-10.f90: New test. * gfortran.dg/real8-16.f90: New test. * gfortran.dg/real8-4.f90: New test.
This commit is contained in:
parent
f3641ac70e
commit
d259ab1576
17 changed files with 354 additions and 44 deletions
|
@ -3066,8 +3066,7 @@ gfc_match_old_kind_spec (gfc_typespec *ts)
|
|||
if (flag_real4_kind == 16)
|
||||
ts->kind = 16;
|
||||
}
|
||||
|
||||
if (ts->kind == 8)
|
||||
else if (ts->kind == 8)
|
||||
{
|
||||
if (flag_real8_kind == 4)
|
||||
ts->kind = 4;
|
||||
|
@ -3246,8 +3245,7 @@ close_brackets:
|
|||
if (flag_real4_kind == 16)
|
||||
ts->kind = 16;
|
||||
}
|
||||
|
||||
if (ts->kind == 8)
|
||||
else if (ts->kind == 8)
|
||||
{
|
||||
if (flag_real8_kind == 4)
|
||||
ts->kind = 4;
|
||||
|
|
|
@ -676,26 +676,6 @@ done:
|
|||
goto cleanup;
|
||||
}
|
||||
kind = gfc_default_double_kind;
|
||||
|
||||
if (kind == 4)
|
||||
{
|
||||
if (flag_real4_kind == 8)
|
||||
kind = 8;
|
||||
if (flag_real4_kind == 10)
|
||||
kind = 10;
|
||||
if (flag_real4_kind == 16)
|
||||
kind = 16;
|
||||
}
|
||||
|
||||
if (kind == 8)
|
||||
{
|
||||
if (flag_real8_kind == 4)
|
||||
kind = 4;
|
||||
if (flag_real8_kind == 10)
|
||||
kind = 10;
|
||||
if (flag_real8_kind == 16)
|
||||
kind = 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
|
@ -726,26 +706,6 @@ done:
|
|||
if (kind == -2)
|
||||
kind = gfc_default_real_kind;
|
||||
|
||||
if (kind == 4)
|
||||
{
|
||||
if (flag_real4_kind == 8)
|
||||
kind = 8;
|
||||
if (flag_real4_kind == 10)
|
||||
kind = 10;
|
||||
if (flag_real4_kind == 16)
|
||||
kind = 16;
|
||||
}
|
||||
|
||||
if (kind == 8)
|
||||
{
|
||||
if (flag_real8_kind == 4)
|
||||
kind = 4;
|
||||
if (flag_real8_kind == 10)
|
||||
kind = 10;
|
||||
if (flag_real8_kind == 16)
|
||||
kind = 16;
|
||||
}
|
||||
|
||||
if (gfc_validate_kind (BT_REAL, kind, true) < 0)
|
||||
{
|
||||
gfc_error ("Invalid real kind %d at %C", kind);
|
||||
|
|
23
gcc/testsuite/gfortran.dg/real4-10-real8-10.f90
Normal file
23
gcc/testsuite/gfortran.dg/real4-10-real8-10.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run { target i?86-*-* x86_64-*-* } }
|
||||
! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-10" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2
|
||||
end program test
|
24
gcc/testsuite/gfortran.dg/real4-10-real8-16.f90
Normal file
24
gcc/testsuite/gfortran.dg/real4-10-real8-16.f90
Normal file
|
@ -0,0 +1,24 @@
|
|||
! { dg-do run { target i?86-*-* x86_64-*-* } }
|
||||
! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-16" }
|
||||
! { dg-require-effective-target fortran_real_16 }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2
|
||||
end program test
|
23
gcc/testsuite/gfortran.dg/real4-10-real8-4.f90
Normal file
23
gcc/testsuite/gfortran.dg/real4-10-real8-4.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run { target i?86-*-* x86_64-*-* } }
|
||||
! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-4" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4 ! << this is ambiguous: kind=8 → 4 → 10 or 8 → 4; thus,excluded below
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2
|
||||
end program test
|
23
gcc/testsuite/gfortran.dg/real4-10.f90
Normal file
23
gcc/testsuite/gfortran.dg/real4-10.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run { target i?86-*-* x86_64-*-* } }
|
||||
! { dg-additional-options "-w -freal-4-real-10" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2
|
||||
end program test
|
24
gcc/testsuite/gfortran.dg/real4-16-real8-10.f90
Normal file
24
gcc/testsuite/gfortran.dg/real4-16-real8-10.f90
Normal file
|
@ -0,0 +1,24 @@
|
|||
! { dg-do run { target i?86-*-* x86_64-*-* } }
|
||||
! { dg-additional-options "-w -freal-4-real-16 -freal-8-real-10" }
|
||||
! { dg-require-effective-target fortran_real_16 }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2
|
||||
end program test
|
24
gcc/testsuite/gfortran.dg/real4-16-real8-16.f90
Normal file
24
gcc/testsuite/gfortran.dg/real4-16-real8-16.f90
Normal file
|
@ -0,0 +1,24 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-4-real-16 -freal-8-real-16" }
|
||||
! { dg-require-effective-target fortran_real_16 }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2
|
||||
end program test
|
24
gcc/testsuite/gfortran.dg/real4-16-real8-4.f90
Normal file
24
gcc/testsuite/gfortran.dg/real4-16-real8-4.f90
Normal file
|
@ -0,0 +1,24 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-4-real-16 -freal-8-real-4" }
|
||||
! { dg-require-effective-target fortran_real_16 }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4 ! << this is ambiguous: kind=8 → 4 → 16 or 8 → 4; thus,excluded below
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2
|
||||
end program test
|
24
gcc/testsuite/gfortran.dg/real4-16.f90
Normal file
24
gcc/testsuite/gfortran.dg/real4-16.f90
Normal file
|
@ -0,0 +1,24 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-4-real-16" }
|
||||
! { dg-require-effective-target fortran_real_16 }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2
|
||||
end program test
|
23
gcc/testsuite/gfortran.dg/real4-8-real8-10.f90
Normal file
23
gcc/testsuite/gfortran.dg/real4-8-real8-10.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run { target i?86-*-* x86_64-*-* } }
|
||||
! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-10" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2
|
||||
end program test
|
24
gcc/testsuite/gfortran.dg/real4-8-real8-16.f90
Normal file
24
gcc/testsuite/gfortran.dg/real4-8-real8-16.f90
Normal file
|
@ -0,0 +1,24 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-16" }
|
||||
! { dg-require-effective-target fortran_real_16 }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2
|
||||
end program test
|
23
gcc/testsuite/gfortran.dg/real4-8-real8-4.f90
Normal file
23
gcc/testsuite/gfortran.dg/real4-8-real8-4.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-4" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4 ! << this is ambiguous: kind=8 → 4 → 8 or 8 → 4; thus,excluded below
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2
|
||||
end program test
|
23
gcc/testsuite/gfortran.dg/real4-8.f90
Normal file
23
gcc/testsuite/gfortran.dg/real4-8.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-4-real-8" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2
|
||||
end program test
|
23
gcc/testsuite/gfortran.dg/real8-10.f90
Normal file
23
gcc/testsuite/gfortran.dg/real8-10.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run { target i?86-*-* x86_64-*-* } }
|
||||
! { dg-additional-options "-w -freal-8-real-10" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2
|
||||
end program test
|
24
gcc/testsuite/gfortran.dg/real8-16.f90
Normal file
24
gcc/testsuite/gfortran.dg/real8-16.f90
Normal file
|
@ -0,0 +1,24 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-8-real-16" }
|
||||
! { dg-require-effective-target fortran_real_16 }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2
|
||||
end program test
|
23
gcc/testsuite/gfortran.dg/real8-4.f90
Normal file
23
gcc/testsuite/gfortran.dg/real8-4.f90
Normal file
|
@ -0,0 +1,23 @@
|
|||
! { dg-do run }
|
||||
! { dg-additional-options "-w -freal-8-real-4" }
|
||||
!
|
||||
! PR fortran/99355
|
||||
!
|
||||
|
||||
program test
|
||||
real :: r1
|
||||
real*4:: r2
|
||||
real(4) :: r3
|
||||
real(selected_real_kind(p=6)) :: r4
|
||||
|
||||
double precision :: d1
|
||||
real*8 :: d2
|
||||
real(8) :: d3
|
||||
real(kind(1.d0)) :: d4
|
||||
real(selected_real_kind(p=15)) :: d5
|
||||
|
||||
!print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4)
|
||||
!print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)
|
||||
if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1
|
||||
if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 4)) stop 2
|
||||
end program test
|
Loading…
Add table
Reference in a new issue