https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57822

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Something such as

! { dg-do run }
! PR58722
program testit
use ISO_FORTRAN_ENV
  implicit none
  integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
  character(50) :: astring
  integer :: i, l, n

  n = 0
  do i=1,size(real_kinds)
    if (i == 1) then
      write(astring, '(g0)') 1.0/real(10.0, kind=j(1))
    else if (i == 2) then
      write(astring, '(g0)') 1.0/real(10.0, kind=j(2))
    else if (i == 3) then
      write(astring, '(g0)') 1.0/real(10.0, kind=j(3))
    else if (i == 4) then
      write(astring, '(g0)') 1.0/real(10.0, kind=j(4))
    end if
    l = index(astring, 'E')
    if (l /= 0) then
      print *, i, l, trim(astring)
      n = n + l
    end if
  end do
  if (n /= 0) call abort

end program

should do the trick.

Note that the output of this test on powerpc-apple-darwin9 r220529 is

           3          38 .999999999999999999999999999999996919E-0001

so it seems that the test will fail on powerpc* using the "IBM" REAL(16).

Reply via email to