| 1 |
! { dg-do run } |
| 2 |
! This is a libgfortran (runtime library) test, need to run only once! |
| 3 |
! |
| 4 |
! { dg-additional-options "-funsigned" } |
| 5 |
! |
| 6 |
! PR libfortran/118536 - G formatting for UNSIGNED |
| 7 |
|
| 8 |
program print_unsigned_g_formatted |
| 9 |
character(21) :: s1, s2 |
| 10 |
unsigned(1) :: u1 = huge(0U_1) |
| 11 |
unsigned(2) :: u2 = huge(0U_2) |
| 12 |
unsigned(4) :: u4 = huge(0U_4) |
| 13 |
unsigned(8) :: u8 = huge(0U_8) |
| 14 |
|
| 15 |
write(s1,'(i0)') u1 |
| 16 |
write(s2,'(g0)') u1 |
| 17 |
if (s1 /= s2) stop 1 |
| 18 |
|
| 19 |
write(s1,'(i0)') u2 |
| 20 |
write(s2,'(g0)') u2 |
| 21 |
if (s1 /= s2) stop 2 |
| 22 |
|
| 23 |
write(s1,'(i0)') u4 |
| 24 |
write(s2,'(g0)') u4 |
| 25 |
if (s1 /= s2) stop 3 |
| 26 |
|
| 27 |
write(s1,'(i0)') u8 |
| 28 |
write(s2,'(g0)') u8 |
| 29 |
if (s1 /= s2) stop 4 |
| 30 |
end |