| 1 |
! { dg-do run } |
| 2 |
! PR114618 Format produces incorrect output when contains 1x, ok when uses " " |
| 3 |
! aside: Before patch output1 is garbage. |
| 4 |
program pr114618 |
| 5 |
implicit none |
| 6 |
integer, parameter :: wp = kind(0d0) |
| 7 |
real(kind=wp) :: pi = 3.14159265358979323846264338_wp |
| 8 |
character(len=*), parameter:: fmt1 = '(19("."),t1,g0,1x,t21,g0)' |
| 9 |
character(len=*), parameter:: fmt2 = '(19("."),t1,g0," ",t21,g0)' |
| 10 |
character(21) :: output1, output2 |
| 11 |
write (output1, fmt1) 'RADIX', radix(pi) |
| 12 |
write (output2, fmt2) 'RADIX', radix(pi) |
| 13 |
if (output1 /= 'RADIX.............. 2') stop 1 |
| 14 |
if (output2 /= 'RADIX ............. 2') stop 2 |
| 15 |
end program pr114618 |