gcc/testsuite/gfortran.dg/execute_command_line_2.f90
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! Check that EXECUTE_COMMAND_LINE handles invalid command lines appropriately |
| 4 | ! |
| 5 | integer :: s = 0, c = 0 |
| 6 | character(len=255) :: msg = "" |
| 7 | |
| 8 | ! This should fail, set CMDSTAT to nonzero value, and an error message |
| 9 | ! in CMDMSG. |
| 10 | call execute_command_line ("/nosuchfile", exitstat=s, cmdstat=c, cmdmsg=msg) |
| 11 | if (c == 0) STOP 1 |
| 12 | if (len_trim(msg) == 0) STOP 2 |
| 13 | |
| 14 | end |