diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-10-10 16:49:32 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-10-10 16:49:32 +0000 |
commit | 3934b625ee2f522edf455191d1eaaa42e265a1d9 (patch) | |
tree | 6d2aba7bdb402ff9984c97114d2053a2282a468b /gcc | |
parent | 53befce7f2b35e69ad78b945fc06403c753480a5 (diff) | |
download | gcc-3934b625ee2f522edf455191d1eaaa42e265a1d9.zip gcc-3934b625ee2f522edf455191d1eaaa42e265a1d9.tar.gz gcc-3934b625ee2f522edf455191d1eaaa42e265a1d9.tar.bz2 |
re PR libfortran/82233 (execute_command_line causes program to stop when command fails (or does not exist))
2017-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/82233
* intrinsics/execute_command_line.c (execute_command_line):
No call to runtime_error if cmdstat is present.
2017-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/82233
* gfortran.dg/execute_command_line_3.f90: New test.
From-SVN: r253593
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/execute_command_line_3.f90 | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e73439f..ae985df 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-10 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/82233 + * gfortran.dg/execute_command_line_3.f90: New test. + 2017-10-10 Will Schmidt <will_schmidt@vnet.ibm.com> * gcc.target/powerpc/fold-vec-splat-16.c: New diff --git a/gcc/testsuite/gfortran.dg/execute_command_line_3.f90 b/gcc/testsuite/gfortran.dg/execute_command_line_3.f90 new file mode 100644 index 0000000..87d73d1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/execute_command_line_3.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! PR 82233 - there were program aborts for some of these commands. +! Original test case by Urban Jost. +program boom +implicit none +integer :: i,j +character(len=256) :: msg +character(len=:), allocatable :: command + command='notthere' + msg='' ! seems to only be defined if exitstatus.ne.0 + ! ok -- these work + call execute_command_line(command , wait=.false., exitstat=i, cmdstat=j, cmdmsg=msg) + if (j /= 0 .or. msg /= '') call abort + call execute_command_line(command , exitstat=i, cmdstat=j, cmdmsg=msg ) + if (j /= 3 .or. msg /= "Invalid command line" ) call abort + msg = '' + call execute_command_line(command , wait=.false., exitstat=i, cmdmsg=msg ) + print *,msg + if (msg /= '') call abort + call execute_command_line(command , exitstat=i, cmdstat=j ) + if (j /= 3) call abort + call execute_command_line(command , wait=.false., exitstat=i ) + +end program boom |