summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/execute_command_line_2.f90
blob: 5a4e9cc7b8299a812d93a8075b7f1534ba495e0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
! { dg-do run }
!
! Check that EXECUTE_COMMAND_LINE handles invalid command lines appropriately
!
  integer :: s = 0, c = 0
  character(len=255) :: msg = ""

  ! This should fail, set CMDSTAT to nonzero value, and an error message
  ! in CMDMSG.
  call execute_command_line ("/nosuchfile", exitstat=s, cmdstat=c, cmdmsg=msg)
  if (c == 0) call abort
  if (len_trim(msg) == 0) call abort

end