hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / execute_command_line_1.f90
blobfaaa860c9b417d5fd7114e497d39e136935d6c89
1 ! { dg-do compile }
3 ! Check that we accept all variants of the EXECUTE_COMMAND_LINE intrinsic.
5 integer :: i, j
6 character(len=100) :: s
8 s = ""
10 call execute_command_line ("ls *.f90")
12 print *, "-----------------------------"
14 call execute_command_line ("sleep 1 ; ls *.f90", .false.)
15 print *, "I'm not waiting"
16 call sleep(2)
18 print *, "-----------------------------"
20 call execute_command_line ("sleep 1 ; ls *.f90", .true.)
21 print *, "I did wait"
22 call sleep(2)
24 print *, "-----------------------------"
26 call execute_command_line ("ls *.f90", .true., i)
27 print *, "Exist status was: ", i
29 print *, "-----------------------------"
31 call execute_command_line ("ls *.doesnotexist", .true., i)
32 print *, "Exist status was: ", i
34 print *, "-----------------------------"
36 call execute_command_line ("echo foo", .true., i, j)
37 print *, "Exist status was: ", i
38 print *, "Command status was: ", j
40 print *, "-----------------------------"
42 call execute_command_line ("echo foo", .true., i, j, s)
43 print *, "Exist status was: ", i
44 print *, "Command status was: ", j
45 print *, "Error message is: ", trim(s)
47 print *, "-----------------------------"
49 call execute_command_line ("ls *.doesnotexist", .true., i, j, s)
50 print *, "Exist status was: ", i
51 print *, "Command status was: ", j
52 print *, "Error message is: ", trim(s)
54 print *, "-----------------------------"
56 call execute_command_line ("sleep 20", .false.)
57 print *, "Please kill me with ^C"
58 call sleep (10)
60 end