xref: /original-bsd/usr.bin/f77/tests/tests/fm003.f (revision 21df4bd6)
1c     comment section
2c
3c     fm003
4c
5c         this routine contains the basic continue tests.  these tests
6c     ensure that execution of a continue statement causes continuation
7c     of the normal program execution sequence.  only the statements in
8c     the basic assumptions are included in these tests.  other continue
9c     tests are contained in other routines as part of the tests for
10c     other language features such as the do statements tests.
11c
12c      references
13c        american national standard programming language fortran,
14c              x3.9-1978
15c
16c        section 3.6, normal execution sequence and transfer of control
17c        section 11.11, continue statement
18c
19c
20c      **********************************************************
21c
22c         a compiler validation system for the fortran language
23c     based on specifications as defined in american national standard
24c     programming language fortran x3.9-1978, has been developed by the
25c     federal cobol compiler testing service.  the fortran compiler
26c     validation system (fcvs) consists of audit routines, their related
27c     data, and an executive system.  each audit routine is a fortran
28c     program, subprogram or function which includes tests of specific
29c     language elements and supporting procedures indicating the result
30c     of executing these tests.
31c
32c         this particular program/subprogram/function contains features
33c     found only in the subset as defined in x3.9-1978.
34c
35c         suggestions and comments should be forwarded to -
36c
37c                  department of the navy
38c                  federal cobol compiler testing service
39c                  washington, d.c.  20376
40c
41c      **********************************************************
42c
43c
44c
45c     initialization section
46c
47c     initialize constants
48c      **************
49c     i01 contains the logical unit number for the card reader.
50      i01 = 5
51c     i02 contains the logical unit number for the printer.
52      i02 = 6
53c     system environment section
54c
55cx010    this card is replaced by contents of fexec x-010 control card.
56c     the cx010 card is for overriding the program default i01 = 5
57c     (unit number for card reader).
58cx011    this card is replaced by contents of fexec x-011 control card.
59c     the cx011 card is for systems which require additional
60c     fortran statements for files associated with cx010 above.
61c
62cx020    this card is replaced by contents of fexec x-020 control card.
63c     the cx020 card is for overriding the program default i02 = 6
64c     (unit number for printer).
65cx021    this card is replaced by contents of fexec x-021 control card.
66c     the cx021 card is for systems which require additional
67c     fortran statements for files associated with cx020 above.
68c
69      ivpass=0
70      ivfail=0
71      ivdele=0
72      iczero=0
73c
74c     write page headers
75      write (i02,90000)
76      write (i02,90001)
77      write (i02,90002)
78      write (i02, 90002)
79      write (i02,90003)
80      write (i02,90002)
81      write (i02,90004)
82      write (i02,90002)
83      write (i02,90011)
84      write (i02,90002)
85      write (i02,90002)
86      write (i02,90005)
87      write (i02,90006)
88      write (i02,90002)
89  131 continue
90      ivtnum =  13
91c
92c      ****  test 013  ****
93c         test 13 - continue test
94c               continue statement following integer assignment
95c               statements.
96c
97      if (iczero) 30130,  130, 30130
98  130 continue
99      ivon01=5
100      ivon02=6
101      continue
102      go to 40130
10330130 ivdele = ivdele + 1
104      write (i02,80003) ivtnum
105      if (iczero) 40130,  141, 40130
10640130 if (ivon01-5) 20131,40131,20131
10740131 if (ivon02-6) 20132,10130,20132
10810130 ivpass = ivpass + 1
109      write (i02,80001) ivtnum
110      go to  141
11120131 ivcomp=ivon01
112      ivcorr=5
113      go to 20130
11420132 ivcomp=ivon02
115      ivcorr=6
11620130 ivfail = ivfail + 1
117      write (i02,80004) ivtnum, ivcomp ,ivcorr
118  141 continue
119      ivtnum =  14
120c
121c      ****  test 014  ****
122c         test 14 - continue test
123c               continue statement between integer assignment
124c               statements
125c
126      if (iczero) 30140,  140, 30140
127  140 continue
128      ivon01=14
129      continue
130      ivon02=15
131      go to 40140
13230140 ivdele = ivdele + 1
133      write (i02,80003) ivtnum
134      if (iczero) 40140,  151, 40140
13540140 if (ivon01 - 14) 20141,40141,20141
13640141 if (ivon02 - 15) 20142, 10140, 20142
13710140 ivpass = ivpass + 1
138      write (i02,80001) ivtnum
139      go to  151
14020141 ivcomp=ivon01
141      ivcorr=14
142      go to 20140
14320142 ivcomp=ivon02
144      ivcorr=15
14520140 ivfail = ivfail + 1
146      write (i02,80004) ivtnum, ivcomp ,ivcorr
147  151 continue
148      ivtnum =  15
149c
150c      ****  test 015  ****
151c         test 15 - continue test
152c               two consecutive continue statements
153c
154      if (iczero) 30150,  150, 30150
155  150 continue
156      continue
157      ivon01=19
158      ivon02=20
159      go to 40150
16030150 ivdele = ivdele + 1
161      write (i02,80003) ivtnum
162      if (iczero) 40150,  161, 40150
16340150 if (ivon01 - 19) 20151,40151,20151
16440151 if (ivon02 -20) 20152,10150,20152
16510150 ivpass = ivpass + 1
166      write (i02,80001) ivtnum
167      go to  161
16820151 ivcomp=ivon01
169      ivcorr=19
170      go to 20150
17120152 ivcomp=ivon02
172      ivcorr=20
17320150 ivfail = ivfail + 1
174      write (i02,80004) ivtnum, ivcomp ,ivcorr
175  161 continue
176      ivtnum =  16
177c
178c      ****  test 016  ****
179c         test 16 - continue test
180c               branch to continue statement from if statement
181c
182      if (iczero) 30160,  160, 30160
183  160 continue
184      ivon01=16
185      if (ivon01 - 16) 162,163,162
186  162 ivcorr=16
187      go to 20160
188  163 continue
189      ivon01=160
190      go to 40160
19130160 ivdele = ivdele + 1
192      write (i02,80003) ivtnum
193      if (iczero) 40160,  171, 40160
19440160 if (ivon01-160) 20161,10160,20161
19510160 ivpass = ivpass + 1
196      write (i02,80001) ivtnum
197      go to  171
19820161 ivcorr=160
19920160 ivfail = ivfail + 1
200      ivcomp=ivon01
201      write (i02,80004) ivtnum, ivcomp ,ivcorr
202  171 continue
203      ivtnum =  17
204c
205c      ****  test 017  ****
206c         test 17 - continue test
207c               two of the branches of an if statement are to the same
208c               continue statement.  the third branch also is made to
209c               a continue statement.
210c
211      if (iczero) 30170,  170, 30170
212  170 continue
213      ivon01=17
214      if (ivon01-19) 173,172,172
215  172 continue
216      ivcorr=17
217      go to 20170
218  173 continue
219      ivon01=170
220      go to 40170
22130170 ivdele = ivdele + 1
222      write (i02,80003) ivtnum
223      if (iczero) 40170,  181, 40170
22440170 if (ivon01 - 170) 20171,10170,20171
22510170 ivpass = ivpass + 1
226      write (i02,80001) ivtnum
227      go to  181
22820171 ivcorr=170
22920170 ivfail = ivfail + 1
230      ivcomp=ivon01
231      write (i02,80004) ivtnum, ivcomp ,ivcorr
232  181 continue
233      ivtnum =  18
234c
235c      ****  test 018  ****
236c         test 18 - continue test
237c               branch to continue statement from go to statement
238c
239      if (iczero) 30180,  180, 30180
240  180 continue
241      if (iczero) 184,182,184
242  182 ivon01=18
243      go to 183
244  184 ivon01=20
245  183 continue
246      ivon02=180
247      go to 40180
24830180 ivdele = ivdele + 1
249      write (i02,80003) ivtnum
250      if (iczero) 40180,  191, 40180
25140180 if (ivon01 - 18) 20181,40181,20181
25240181 if (ivon02 -180) 20182,10180,20182
25310180 ivpass = ivpass + 1
254      write (i02,80001) ivtnum
255      go to  191
25620181 ivcorr=18
257      ivcomp=ivon01
258      go to 20180
25920182 ivcomp=ivon02
260      ivcorr=180
26120180 ivfail = ivfail + 1
262      write (i02,80004) ivtnum, ivcomp ,ivcorr
263  191 continue
264      ivtnum =  19
265c
266c      ****  test 019  ****
267c         test 19 - continue test
268c             branch to three  continue statements  from if statement.
269c               continue statements follow each other.
270c
271      if (iczero) 30190,  190, 30190
272  190 continue
273      icone = 1
274      if (icone) 194,192,193
275  193 continue
276  192 continue
277  194 continue
278      ivon01=19
279      go to 40190
28030190 ivdele = ivdele + 1
281      write (i02,80003) ivtnum
282      if (iczero) 40190,  201, 40190
28340190 if (ivon01 - 19) 20190,10190,20190
28410190 ivpass = ivpass + 1
285      write (i02,80001) ivtnum
286      go to  201
28720190 ivfail = ivfail + 1
288      ivcomp=ivon01
289      ivcorr=19
290      write (i02,80004) ivtnum, ivcomp ,ivcorr
291  201 continue
292      ivtnum =  20
293c
294c      ****  test 020  ****
295c         test 20 - continue test
296c               three separate branches of an if statement are to
297c               continue statements.
298c
299      if (iczero) 30200,  200, 30200
300  200 continue
301      icon02=-2
302      if  (icon02) 204,202,203
303  203 continue
304      ivon01=203
305      go to 40200
306  204 continue
307      ivon01 = 204
308      go to 40200
309  202 continue
310      ivon01=202
311      go to 40200
31230200 ivdele = ivdele + 1
313      write (i02,80003) ivtnum
314      if (iczero) 40200,  211, 40200
31540200 if (ivon01 - 204) 20200,10200,20200
31610200 ivpass = ivpass + 1
317      write (i02,80001) ivtnum
318      go to  211
31920200 ivfail = ivfail + 1
320      ivcomp=ivon01
321      ivcorr=204
322      write (i02,80004) ivtnum, ivcomp ,ivcorr
323  211 continue
324c
325c     write page footings and run summaries
32699999 continue
327      write (i02,90002)
328      write (i02,90006)
329      write (i02,90002)
330      write (i02,90002)
331      write (i02,90007)
332      write (i02,90002)
333      write (i02,90008)  ivfail
334      write (i02,90009) ivpass
335      write (i02,90010) ivdele
336c
337c
338c     terminate routine execution
339      stop
340c
341c     format statements for page headers
34290000 format (1h1)
34390002 format (1h )
34490001 format (1h ,10x,34hfortran compiler validation system)
34590003 format (1h ,21x,11hversion 1.0)
34690004 format (1h ,10x,38hfor official use only - copyright 1978)
34790005 format (1h ,5x,4htest,5x,9hpass/fail, 5x,8hcomputed,8x,7hcorrect)
34890006 format (1h ,5x,46h----------------------------------------------)
34990011 format (1h ,18x,17hsubset level test)
350c
351c     format statements for run summaries
35290008 format (1h ,15x,i5,19h errors encountered)
35390009 format (1h ,15x,i5,13h tests passed)
35490010 format (1h ,15x,i5,14h tests deleted)
355c
356c     format statements for test results
35780001 format (1h ,4x,i5,7x,4hpass)
35880002 format (1h ,4x,i5,7x,4hfail)
35980003 format (1h ,4x,i5,7x,7hdeleted)
36080004 format (1h ,4x,i5,7x,4hfail,10x,i6,9x,i6)
36180005 format (1h ,4x,i5,7x,4hfail,4x,e12.5,3x,e12.5)
362c
36390007 format (1h ,20x,20hend of program fm003)
364      end
365