| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-funsigned -pedantic" } |
| 3 |
program memain |
| 4 |
implicit none |
| 5 |
integer :: iostat |
| 6 |
character(len=100) :: iomsg |
| 7 |
unsigned :: u |
| 8 |
open (10) |
| 9 |
write (10,'(I10)') -1 |
| 10 |
write (10,'(I10)') 2_8**32 |
| 11 |
rewind 10 |
| 12 |
read (10,'(I10)',iostat=iostat,iomsg=iomsg) u |
| 13 |
if (iostat == 0) error stop 1 |
| 14 |
if (iomsg /= "Negative sign for unsigned integer read") error stop 2 |
| 15 |
read (10,'(I10)',iostat=iostat,iomsg=iomsg) u |
| 16 |
if (iostat == 0) error stop 3 |
| 17 |
if (iomsg /= "Value overflowed during unsigned integer read") error stop 4 |
| 18 |
rewind 10 |
| 19 |
read (10,*,iostat=iostat,iomsg=iomsg) u |
| 20 |
if (iostat == 0) error stop 5 |
| 21 |
if (iomsg /= "Negative sign for unsigned integer in item 1 of list input ") error stop 6 |
| 22 |
read (10,*,iostat=iostat,iomsg=iomsg) u |
| 23 |
if (iostat == 0) error stop 7 |
| 24 |
if (iomsg /= "Unsigned integer overflow while reading item 1 of list input") error stop 8 |
| 25 |
close(unit=10, status='delete') |
| 26 |
end program memain |