xref: /original-bsd/usr.bin/f77/tests/tests/fs054.f (revision 9acaf688)
1c
2c     comment section
3c
4c     ff054
5c
6c          ff054 is a function subprogram which is referenced by the
7c     main program.  five integer variable arguments are passed and
8c     several return statements are specified.  the function ff054
9c     adds together the values of the first one, two or three arguments
10c     depending on the value of the fourth argument.  the resulting sum
11c     is then returned to the referencing program fm050 through the
12c     function reference.
13c
14c      references
15c        american national standard programming language fortran,
16c              x3.9-1978
17c
18c        section 15.5.1, function subprogram and function statement
19c        section 15.8, return statement
20c
21c     test section
22c
23c         function subprogram - several arguments, several returns
24c
25      integer function ff054 (ivon01,ivon02,ivon03,ivon04)
26      go to (10,20,30),ivon04
2710    ff054 = ivon01
28      return
2920    ff054 = ivon01 + ivon02
30      return
3130    ff054 = ivon01 + ivon02 + ivon03
32      return
33      end
34