|
|
1.1 root 1: c comment section
2: c
3: c fm028
4: c
5: c this routine contains the external function reference tests.
6: c the function subprogram ff029 is called by this program. the
7: c function subprogram ff029 increments the calling argument by 1
8: c and returns to the calling program.
9: c
10: c execution of an external function reference results in an
11: c association of actual arguments with all appearances of dummy
12: c arguments in the defining subprogram. following these
13: c associations, execution of the first executable statement of the
14: c defining subprogram is undertaken.
15: c
16: c references
17: c american national standard programming language fortran,
18: c x3.9-1978
19: c
20: c section 15.5.2, referencing an external function
21: c
22: integer ff029
23: c
24: c
25: c **********************************************************
26: c
27: c a compiler validation system for the fortran language
28: c based on specifications as defined in american national standard
29: c programming language fortran x3.9-1978, has been developed by the
30: c federal cobol compiler testing service. the fortran compiler
31: c validation system (fcvs) consists of audit routines, their related
32: c data, and an executive system. each audit routine is a fortran
33: c program, subprogram or function which includes tests of specific
34: c language elements and supporting procedures indicating the result
35: c of executing these tests.
36: c
37: c this particular program/subprogram/function contains features
38: c found only in the subset as defined in x3.9-1978.
39: c
40: c suggestions and comments should be forwarded to -
41: c
42: c department of the navy
43: c federal cobol compiler testing service
44: c washington, d.c. 20376
45: c
46: c **********************************************************
47: c
48: c
49: c
50: c initialization section
51: c
52: c initialize constants
53: c **************
54: c i01 contains the logical unit number for the card reader.
55: i01 = 5
56: c i02 contains the logical unit number for the printer.
57: i02 = 6
58: c system environment section
59: c
60: cx010 this card is replaced by contents of fexec x-010 control card.
61: c the cx010 card is for overriding the program default i01 = 5
62: c (unit number for card reader).
63: cx011 this card is replaced by contents of fexec x-011 control card.
64: c the cx011 card is for systems which require additional
65: c fortran statements for files associated with cx010 above.
66: c
67: cx020 this card is replaced by contents of fexec x-020 control card.
68: c the cx020 card is for overriding the program default i02 = 6
69: c (unit number for printer).
70: cx021 this card is replaced by contents of fexec x-021 control card.
71: c the cx021 card is for systems which require additional
72: c fortran statements for files associated with cx020 above.
73: c
74: ivpass=0
75: ivfail=0
76: ivdele=0
77: iczero=0
78: c
79: c write page headers
80: write (i02,90000)
81: write (i02,90001)
82: write (i02,90002)
83: write (i02, 90002)
84: write (i02,90003)
85: write (i02,90002)
86: write (i02,90004)
87: write (i02,90002)
88: write (i02,90011)
89: write (i02,90002)
90: write (i02,90002)
91: write (i02,90005)
92: write (i02,90006)
93: write (i02,90002)
94: c
95: c test section
96: c
97: c external function reference
98: c
99: c external function reference - argument name same as subprogram
100: c argument name.
101: 6701 continue
102: ivtnum = 670
103: c
104: c **** test 670 ****
105: c
106: if (iczero) 36700,6700,36700
107: 6700 continue
108: ivon01 = 0
109: ivcomp = ff029(ivon01)
110: go to 46700
111: 36700 ivdele = ivdele + 1
112: write (i02,80003) ivtnum
113: if (iczero) 46700,6711,46700
114: 46700 if (ivcomp - 1) 26700,16700,26700
115: 16700 ivpass = ivpass + 1
116: write (i02,80001) ivtnum
117: go to 6711
118: 26700 ivfail = ivfail + 1
119: ivcorr = 1
120: write (i02,80004) ivtnum, ivcomp, ivcorr
121: 6711 continue
122: ivtnum = 671
123: c
124: c **** test 671 ****
125: c
126: c external function reference - argument name same as internal
127: c variable in function subprogram.
128: c
129: if (iczero) 36710,6710,36710
130: 6710 continue
131: ivon02 = 2
132: ivon01 = 5
133: ivcomp = ff029(ivon02)
134: go to 46710
135: 36710 ivdele = ivdele + 1
136: write (i02,80003) ivtnum
137: if (iczero) 46710,6721,46710
138: 46710 if (ivcomp - 3) 26710,16710,26710
139: 16710 ivpass = ivpass + 1
140: write (i02,80001) ivtnum
141: go to 6721
142: 26710 ivfail = ivfail + 1
143: ivcorr = 3
144: write (i02,80004) ivtnum, ivcomp, ivcorr
145: 6721 continue
146: ivtnum = 672
147: c
148: c **** test 672 ****
149: c
150: c external function reference - argument name different from
151: c function subprogram argument and internal variable.
152: c
153: if (iczero) 36720,6720,36720
154: 6720 continue
155: ivon01 = 7
156: ivon03 = -12
157: ivcomp = ff029(ivon03)
158: go to 46720
159: 36720 ivdele = ivdele + 1
160: write (i02,80003) ivtnum
161: if (iczero) 46720,6731,46720
162: 46720 if (ivcomp + 11) 26720,16720,26720
163: 16720 ivpass = ivpass + 1
164: write (i02,80001) ivtnum
165: go to 6731
166: 26720 ivfail = ivfail + 1
167: ivcorr = -11
168: write (i02,80004) ivtnum, ivcomp, ivcorr
169: 6731 continue
170: ivtnum = 673
171: c
172: c **** test 673 ****
173: c
174: c repeated external function reference in a do loop.
175: c
176: if (iczero) 36730,6730,36730
177: 6730 continue
178: ivon01 = -7
179: ivcomp = 0
180: do 6732 ivon04 = 1,5
181: ivcomp = ff029(ivcomp)
182: 6732 continue
183: go to 46730
184: 36730 ivdele = ivdele + 1
185: write (i02,80003) ivtnum
186: if (iczero) 46730,6741,46730
187: 46730 if (ivcomp - 5) 26730,16730,26730
188: 16730 ivpass = ivpass + 1
189: write (i02,80001) ivtnum
190: go to 6741
191: 26730 ivfail = ivfail + 1
192: ivcorr = 5
193: write (i02,80004) ivtnum, ivcomp, ivcorr
194: 6741 continue
195: c
196: c write page footings and run summaries
197: 99999 continue
198: write (i02,90002)
199: write (i02,90006)
200: write (i02,90002)
201: write (i02,90002)
202: write (i02,90007)
203: write (i02,90002)
204: write (i02,90008) ivfail
205: write (i02,90009) ivpass
206: write (i02,90010) ivdele
207: c
208: c
209: c terminate routine execution
210: stop
211: c
212: c format statements for page headers
213: 90000 format (1h1)
214: 90002 format (1h )
215: 90001 format (1h ,10x,34hfortran compiler validation system)
216: 90003 format (1h ,21x,11hversion 1.0)
217: 90004 format (1h ,10x,38hfor official use only - copyright 1978)
218: 90005 format (1h ,5x,4htest,5x,9hpass/fail, 5x,8hcomputed,8x,7hcorrect)
219: 90006 format (1h ,5x,46h----------------------------------------------)
220: 90011 format (1h ,18x,17hsubset level test)
221: c
222: c format statements for run summaries
223: 90008 format (1h ,15x,i5,19h errors encountered)
224: 90009 format (1h ,15x,i5,13h tests passed)
225: 90010 format (1h ,15x,i5,14h tests deleted)
226: c
227: c format statements for test results
228: 80001 format (1h ,4x,i5,7x,4hpass)
229: 80002 format (1h ,4x,i5,7x,4hfail)
230: 80003 format (1h ,4x,i5,7x,7hdeleted)
231: 80004 format (1h ,4x,i5,7x,4hfail,10x,i6,9x,i6)
232: 80005 format (1h ,4x,i5,7x,4hfail,4x,e12.5,3x,e12.5)
233: c
234: 90007 format (1h ,20x,20hend of program fm028)
235: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.