xref: /original-bsd/usr.bin/f77/tests/tests/fm026.f (revision e59fb703)
1c     comment section
2c
3c     fm026
4c
5c         this routine contains the basic subroutine reference tests.
6c     the subroutine fs027 is called by this program.  the subroutine
7c     fs027 increments the calling argument by 1 and returns to the
8c     calling program.
9c
10c         execution of a subroutine reference results in an association
11c     of actual arguments with all appearances of dummy arguments in
12c     the defining subprogram.  following these associations, execution
13c     of the first executable statement of the defining subprogram
14c     is undertaken.
15c
16c      references
17c        american national standard programming language fortran,
18c              x3.9-1978
19c
20c        section 15.6.2, subroutine reference
21c
22c      **********************************************************
23c
24c         a compiler validation system for the fortran language
25c     based on specifications as defined in american national standard
26c     programming language fortran x3.9-1978, has been developed by the
27c     federal cobol compiler testing service.  the fortran compiler
28c     validation system (fcvs) consists of audit routines, their related
29c     data, and an executive system.  each audit routine is a fortran
30c     program, subprogram or function which includes tests of specific
31c     language elements and supporting procedures indicating the result
32c     of executing these tests.
33c
34c         this particular program/subprogram/function contains features
35c     found only in the subset as defined in x3.9-1978.
36c
37c         suggestions and comments should be forwarded to -
38c
39c                  department of the navy
40c                  federal cobol compiler testing service
41c                  washington, d.c.  20376
42c
43c      **********************************************************
44c
45c
46c
47c     initialization section
48c
49c     initialize constants
50c      **************
51c     i01 contains the logical unit number for the card reader.
52      i01 = 5
53c     i02 contains the logical unit number for the printer.
54      i02 = 6
55c     system environment section
56c
57cx010    this card is replaced by contents of fexec x-010 control card.
58c     the cx010 card is for overriding the program default i01 = 5
59c     (unit number for card reader).
60cx011    this card is replaced by contents of fexec x-011 control card.
61c     the cx011 card is for systems which require additional
62c     fortran statements for files associated with cx010 above.
63c
64cx020    this card is replaced by contents of fexec x-020 control card.
65c     the cx020 card is for overriding the program default i02 = 6
66c     (unit number for printer).
67cx021    this card is replaced by contents of fexec x-021 control card.
68c     the cx021 card is for systems which require additional
69c     fortran statements for files associated with cx020 above.
70c
71      ivpass=0
72      ivfail=0
73      ivdele=0
74      iczero=0
75c
76c     write page headers
77      write (i02,90000)
78      write (i02,90001)
79      write (i02,90002)
80      write (i02, 90002)
81      write (i02,90003)
82      write (i02,90002)
83      write (i02,90004)
84      write (i02,90002)
85      write (i02,90011)
86      write (i02,90002)
87      write (i02,90002)
88      write (i02,90005)
89      write (i02,90006)
90      write (i02,90002)
91c
92c     test section
93c
94c         subroutine reference - call
95c
96      ivtnum = 666
97c
98c      ****  test 666  ****
99c     subroutine call - argument name same as subroutine argument name.
100c
101      if (iczero) 36660, 6660, 36660
102 6660 continue
103      ivon01 = 0
104      call fs027(ivon01)
105      ivcomp = ivon01
106      go to 46660
10736660 ivdele = ivdele + 1
108      write (i02,80003) ivtnum
109      if (iczero) 46660, 6671, 46660
11046660 if (ivcomp - 1) 26660,16660,26660
11116660 ivpass = ivpass + 1
112      write (i02,80001) ivtnum
113      go to 6671
11426660 ivfail = ivfail + 1
115      ivcorr = 1
116      write (i02,80004) ivtnum, ivcomp ,ivcorr
117 6671 continue
118      ivtnum = 667
119c
120c      ****  test 667  ****
121c     subroutine call - argument name same as internal variable in
122c         subroutine.
123c
124      if (iczero) 36670, 6670, 36670
125 6670 continue
126      ivon02 = 2
127      call fs027(ivon02)
128      ivcomp = ivon02
129      go to 46670
13036670 ivdele = ivdele + 1
131      write (i02,80003) ivtnum
132      if (iczero) 46670, 6681, 46670
13346670 if (ivcomp - 3) 26670,16670,26670
13416670 ivpass = ivpass + 1
135      write (i02,80001) ivtnum
136      go to 6681
13726670 ivfail = ivfail + 1
138      ivcorr = 3
139      write (i02,80004) ivtnum, ivcomp ,ivcorr
140 6681 continue
141      ivtnum = 668
142c
143c      ****  test 668  ****
144c     subroutine call - argument name different from subroutine argument
145c         and internal variable.
146c
147      if (iczero) 36680, 6680, 36680
148 6680 continue
149      ivon01 = 7
150      ivon03 = -12
151      call fs027(ivon03)
152      ivcomp = ivon03
153      go to 46680
15436680 ivdele = ivdele + 1
155      write (i02,80003) ivtnum
156      if (iczero) 46680, 6691, 46680
15746680 if (ivcomp + 11 ) 26680,16680,26680
15816680 ivpass = ivpass + 1
159      write (i02,80001) ivtnum
160      go to 6691
16126680 ivfail = ivfail + 1
162      ivcorr = -11
163      write (i02,80004) ivtnum, ivcomp ,ivcorr
164 6691 continue
165      ivtnum = 669
166c
167c      ****  test 669  ****
168c     repeated subroutine calls in a do loop.
169c
170      if (iczero) 36690, 6690, 36690
171 6690 continue
172      ivcomp = 0
173      do 6692 ivon04 = 1,5
174      call fs027 (ivcomp)
175 6692 continue
176      go to 46690
17736690 ivdele = ivdele + 1
178      write (i02,80003) ivtnum
179      if (iczero) 46690, 6701, 46690
18046690 if (ivcomp - 5) 26690,16690,26690
18116690 ivpass = ivpass + 1
182      write (i02,80001) ivtnum
183      go to 6701
18426690 ivfail = ivfail + 1
185      ivcorr = 5
186      write (i02,80004) ivtnum, ivcomp ,ivcorr
187c      ****     end of tests   ****
188 6701 continue
189c
190c     write page footings and run summaries
19199999 continue
192      write (i02,90002)
193      write (i02,90006)
194      write (i02,90002)
195      write (i02,90002)
196      write (i02,90007)
197      write (i02,90002)
198      write (i02,90008)  ivfail
199      write (i02,90009) ivpass
200      write (i02,90010) ivdele
201c
202c
203c     terminate routine execution
204      stop
205c
206c     format statements for page headers
20790000 format (1h1)
20890002 format (1h )
20990001 format (1h ,10x,34hfortran compiler validation system)
21090003 format (1h ,21x,11hversion 1.0)
21190004 format (1h ,10x,38hfor official use only - copyright 1978)
21290005 format (1h ,5x,4htest,5x,9hpass/fail, 5x,8hcomputed,8x,7hcorrect)
21390006 format (1h ,5x,46h----------------------------------------------)
21490011 format (1h ,18x,17hsubset level test)
215c
216c     format statements for run summaries
21790008 format (1h ,15x,i5,19h errors encountered)
21890009 format (1h ,15x,i5,13h tests passed)
21990010 format (1h ,15x,i5,14h tests deleted)
220c
221c     format statements for test results
22280001 format (1h ,4x,i5,7x,4hpass)
22380002 format (1h ,4x,i5,7x,4hfail)
22480003 format (1h ,4x,i5,7x,7hdeleted)
22580004 format (1h ,4x,i5,7x,4hfail,10x,i6,9x,i6)
22680005 format (1h ,4x,i5,7x,4hfail,4x,e12.5,3x,e12.5)
227c
22890007 format (1h ,20x,20hend of program fm026)
229      end
230