OSDN Git Service

2011-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.fortran-torture / execute / getarg_1.f90
1 ! Check that getarg does somethig sensible.
2 program getarg_1
3   CHARACTER*10 ARGS, ARGS2
4   INTEGER*4 I
5   INTEGER*2 I2
6   I = 0
7   CALL GETARG(I,ARGS)
8   ! This should return the invoking command.  The actual value depends 
9   ! on the OS, but a blank string is wrong no matter what.
10   ! ??? What about deep embedded systems?
11
12   I2 = 0
13   CALL GETARG(I2,ARGS2)
14   if (args2.ne.args) call abort
15
16   if (args.eq.'') call abort
17   I = 1
18   CALL GETARG(I,ARGS)
19   if (args.ne.'') call abort
20   I = -1
21   CALL GETARG(I,ARGS)
22   if (args.ne.'') call abort
23   ! Assume we won't have been called with more that 4 args.
24   I = 4
25   CALL GETARG(I,ARGS)
26   if (args.ne.'') call abort
27   I = 1000
28   CALL GETARG(I,ARGS)
29   if (args.ne.'') call abort
30 end