| 1 |
! { dg-do run } |
| 2 |
! PR 82233 - there were program aborts for some of these commands. |
| 3 |
! Original test case by Urban Jost. |
| 4 |
program boom |
| 5 |
implicit none |
| 6 |
integer :: i,j |
| 7 |
character(len=256) :: msg |
| 8 |
character(len=:), allocatable :: command |
| 9 |
command='notthere' |
| 10 |
msg='' ! seems to only be defined if exitstatus.ne.0 |
| 11 |
! ok -- these work |
| 12 |
call execute_command_line(command , wait=.false., exitstat=i, cmdstat=j, cmdmsg=msg) |
| 13 |
if (j /= 0 .or. msg /= '') STOP 1 |
| 14 |
call execute_command_line(command , exitstat=i, cmdstat=j, cmdmsg=msg ) |
| 15 |
if (j /= 3 .or. msg /= "Invalid command line" ) STOP 2 |
| 16 |
msg = '' |
| 17 |
call execute_command_line(command , wait=.false., exitstat=i, cmdmsg=msg ) |
| 18 |
if (j /= 3) STOP 3 |
| 19 |
call execute_command_line(command , wait=.false., exitstat=i ) |
| 20 |
if (msg /= '') STOP 4 |
| 21 |
call execute_command_line(command , exitstat=i, cmdstat=j ) |
| 22 |
|
| 23 |
end program boom |