aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/execute_command_line_3.f9024
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