| ! { dg-shouldfail "The users message" } |
| interface read (formatted) |
| module procedure read_formatted |
| end interface read (formatted) |
| subroutine read_formatted (dtv, unit, iotype, vlist, piostat, piomsg) |
| class (char), intent(inout) :: dtv |
| integer, intent(in) :: unit |
| character (len=*), intent(in) :: iotype |
| integer, intent(in) :: vlist(:) |
| integer, intent(out) :: piostat |
| character (len=*), intent(inout) :: piomsg |
| read (unit,fmt='(A1)', advance="no", iostat=piostat, iomsg=piomsg) ch |
| piomsg="The users message containing % and %% and %s and other stuff" |
| end subroutine read_formatted |
| open (10,status="scratch") |
| write (*,'(10(A))') "Read: '",x%ch,"'" |
| ! { dg-output ".*(unit = 10, file = .*)" } |
| ! { dg-output "Fortran runtime error: The users message containing % and %% and %s and other stuff" } |