|
|
1.1 ! root 1: c comment section ! 2: c ! 3: c fm045 ! 4: c ! 5: c this routine tests arithmetic assignments using integer ! 6: c variables connected by a series of arithmetic operators. ! 7: c different combinations of parenthetical notation are exercized. ! 8: c ! 9: c ! 10: c references ! 11: c american national standard programming language fortran, ! 12: c x3.9-1978 ! 13: c ! 14: c section 4.3, integer type ! 15: c section 4.3.1, integer constant ! 16: c section 6.1, arithmetic expressions ! 17: c section 6.6, evaluation of expressions ! 18: c section 10.1, arithmetic assignment statement ! 19: c ! 20: c ! 21: c ! 22: c ********************************************************** ! 23: c ! 24: c a compiler validation system for the fortran language ! 25: c based on specifications as defined in american national standard ! 26: c programming language fortran x3.9-1978, has been developed by the ! 27: c federal cobol compiler testing service. the fortran compiler ! 28: c validation system (fcvs) consists of audit routines, their related ! 29: c data, and an executive system. each audit routine is a fortran ! 30: c program, subprogram or function which includes tests of specific ! 31: c language elements and supporting procedures indicating the result ! 32: c of executing these tests. ! 33: c ! 34: c this particular program/subprogram/function contains features ! 35: c found only in the subset as defined in x3.9-1978. ! 36: c ! 37: c suggestions and comments should be forwarded to - ! 38: c ! 39: c department of the navy ! 40: c federal cobol compiler testing service ! 41: c washington, d.c. 20376 ! 42: c ! 43: c ********************************************************** ! 44: c ! 45: c ! 46: c ! 47: c initialization section ! 48: c ! 49: c initialize constants ! 50: c ************** ! 51: c i01 contains the logical unit number for the card reader. ! 52: i01 = 5 ! 53: c i02 contains the logical unit number for the printer. ! 54: i02 = 6 ! 55: c system environment section ! 56: c ! 57: cx010 this card is replaced by contents of fexec x-010 control card. ! 58: c the cx010 card is for overriding the program default i01 = 5 ! 59: c (unit number for card reader). ! 60: cx011 this card is replaced by contents of fexec x-011 control card. ! 61: c the cx011 card is for systems which require additional ! 62: c fortran statements for files associated with cx010 above. ! 63: c ! 64: cx020 this card is replaced by contents of fexec x-020 control card. ! 65: c the cx020 card is for overriding the program default i02 = 6 ! 66: c (unit number for printer). ! 67: cx021 this card is replaced by contents of fexec x-021 control card. ! 68: c the cx021 card is for systems which require additional ! 69: c fortran statements for files associated with cx020 above. ! 70: c ! 71: ivpass=0 ! 72: ivfail=0 ! 73: ivdele=0 ! 74: iczero=0 ! 75: c ! 76: c 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) ! 91: c ! 92: c ! 93: c test section ! 94: c ! 95: c arithmetic assignment statement ! 96: c ! 97: c ! 98: c tests 747 through 755 use the same string of variables and ! 99: c operators, but use different combinations of parenthetical ! 100: c notation to alter priorities in order of evaluation. ! 101: c ! 102: c tests 756 through 759 check the capability to enclose the entire ! 103: c right hand side of an assignment statement in parentheses or sets ! 104: c of nested parentheses. ! 105: c ! 106: c ! 107: c ! 108: c ! 109: c ! 110: c ! 111: c ! 112: ivtnum = 747 ! 113: c ! 114: c **** test 747 **** ! 115: c ! 116: if (iczero) 37470, 7470, 37470 ! 117: 7470 continue ! 118: ivon01 = 15 ! 119: ivon02 = 9 ! 120: ivon03 = 4 ! 121: ivon04 = 18 ! 122: ivon05 = 6 ! 123: ivon06 = 2 ! 124: ivcomp = ivon01 + ivon02 - ivon03 * ivon04 / ivon05 ** ivon06 ! 125: go to 47470 ! 126: 37470 ivdele = ivdele + 1 ! 127: write (i02,80003) ivtnum ! 128: if (iczero) 47470, 7481, 47470 ! 129: 47470 if (ivcomp - 22) 27470,17470,27470 ! 130: 17470 ivpass = ivpass + 1 ! 131: write (i02,80001) ivtnum ! 132: go to 7481 ! 133: 27470 ivfail = ivfail + 1 ! 134: ivcorr = 22 ! 135: write (i02,80004) ivtnum, ivcomp, ivcorr ! 136: 7481 continue ! 137: ivtnum = 748 ! 138: c ! 139: c **** test 748 **** ! 140: c ! 141: if (iczero) 37480, 7480, 37480 ! 142: 7480 continue ! 143: ivon01 = 15 ! 144: ivon02 = 9 ! 145: ivon03 = 4 ! 146: ivon04 = 18 ! 147: ivon05 = 6 ! 148: ivon06 = 2 ! 149: ivcomp = ((((ivon01 + ivon02) - ivon03) * ivon04) / ivon05) ! 150: * ** ivon06 ! 151: go to 47480 ! 152: 37480 ivdele = ivdele + 1 ! 153: write (i02,80003) ivtnum ! 154: if (iczero) 47480, 7491, 47480 ! 155: 47480 if (ivcomp - 3600) 27480,17480,27480 ! 156: 17480 ivpass = ivpass + 1 ! 157: write (i02,80001) ivtnum ! 158: go to 7491 ! 159: 27480 ivfail = ivfail + 1 ! 160: ivcorr = 3600 ! 161: write (i02,80004) ivtnum, ivcomp, ivcorr ! 162: 7491 continue ! 163: ivtnum = 749 ! 164: c ! 165: c **** test 749 **** ! 166: c ! 167: if (iczero) 37490, 7490, 37490 ! 168: 7490 continue ! 169: ivon01 = 15 ! 170: ivon02 = 9 ! 171: ivon03 = 4 ! 172: ivon04 = 36 ! 173: ivon05 = 6 ! 174: ivon06 = 2 ! 175: ivcomp = (ivon01 + ivon02 - ivon03) * (ivon04 / ivon05 ** ivon06) ! 176: go to 47490 ! 177: 37490 ivdele = ivdele + 1 ! 178: write (i02,80003) ivtnum ! 179: if (iczero) 47490, 7501, 47490 ! 180: 47490 if (ivcomp - 20) 27490,17490,27490 ! 181: 17490 ivpass = ivpass + 1 ! 182: write (i02,80001) ivtnum ! 183: go to 7501 ! 184: 27490 ivfail = ivfail + 1 ! 185: ivcorr = 20 ! 186: write (i02,80004) ivtnum, ivcomp, ivcorr ! 187: 7501 continue ! 188: ivtnum = 750 ! 189: c ! 190: c **** test 750 **** ! 191: c ! 192: if (iczero) 37500, 7500, 37500 ! 193: 7500 continue ! 194: ivon01 = 15 ! 195: ivon02 = 9 ! 196: ivon03 = 4 ! 197: ivon04 = 36 ! 198: ivon05 = 6 ! 199: ivon06 = 2 ! 200: ivcomp = (ivon01 + ivon02) - (ivon03 * ivon04) / (ivon05 ** ! 201: * ivon06) ! 202: go to 47500 ! 203: 37500 ivdele = ivdele + 1 ! 204: write (i02,80003) ivtnum ! 205: if (iczero) 47500, 7511, 47500 ! 206: 47500 if (ivcomp - 20) 27500,17500,27500 ! 207: 17500 ivpass = ivpass + 1 ! 208: write (i02,80001) ivtnum ! 209: go to 7511 ! 210: 27500 ivfail = ivfail + 1 ! 211: ivcorr = 20 ! 212: write (i02,80004) ivtnum, ivcomp, ivcorr ! 213: 7511 continue ! 214: ivtnum = 751 ! 215: c ! 216: c **** test 751 **** ! 217: c ! 218: if (iczero) 37510, 7510, 37510 ! 219: 7510 continue ! 220: ivon01 = 15 ! 221: ivon02 = 9 ! 222: ivon03 = 4 ! 223: ivon04 = 36 ! 224: ivon05 = 6 ! 225: ivon06 = 2 ! 226: ivcomp = ((ivon01 + ivon02) - (ivon03 * ivon04)) / (ivon05 ** ! 227: * ivon06) ! 228: go to 47510 ! 229: 37510 ivdele = ivdele + 1 ! 230: write (i02,80003) ivtnum ! 231: if (iczero) 47510, 7521, 47510 ! 232: 47510 if (ivcomp + 3) 27510,17510,27510 ! 233: 17510 ivpass = ivpass + 1 ! 234: write (i02,80001) ivtnum ! 235: go to 7521 ! 236: 27510 ivfail = ivfail + 1 ! 237: ivcorr = -3 ! 238: c actual answer is -3.333333... truncation is necessary ! 239: write (i02,80004) ivtnum, ivcomp, ivcorr ! 240: 7521 continue ! 241: ivtnum = 752 ! 242: c ! 243: c **** test 752 **** ! 244: c ! 245: if (iczero) 37520, 7520, 37520 ! 246: 7520 continue ! 247: ivon01 = 15 ! 248: ivon02 = 9 ! 249: ivon03 = 4 ! 250: ivon04 = 36 ! 251: ivon05 = 6 ! 252: ivon06 = 2 ! 253: ivcomp = (ivon01 + ivon02) - (ivon03 * ivon04 / ivon05) ** ivon06 ! 254: go to 47520 ! 255: 37520 ivdele = ivdele + 1 ! 256: write (i02,80003) ivtnum ! 257: if (iczero) 47520, 7531, 47520 ! 258: 47520 if (ivcomp + 552) 27520,17520,27520 ! 259: 17520 ivpass = ivpass + 1 ! 260: write (i02,80001) ivtnum ! 261: go to 7531 ! 262: 27520 ivfail = ivfail + 1 ! 263: ivcorr = -552 ! 264: write (i02,80004) ivtnum, ivcomp, ivcorr ! 265: 7531 continue ! 266: ivtnum = 753 ! 267: c ! 268: c **** test 753 **** ! 269: c ! 270: if (iczero) 37530, 7530, 37530 ! 271: 7530 continue ! 272: ivon01 = 15 ! 273: ivon02 = 9 ! 274: ivon03 = 4 ! 275: ivon04 = 36 ! 276: ivon05 = 6 ! 277: ivon06 = 2 ! 278: ivcomp = ivon01 + (ivon02 - ivon03 * ivon04) / ivon05 ** ivon06 ! 279: go to 47530 ! 280: 37530 ivdele = ivdele + 1 ! 281: write (i02,80003) ivtnum ! 282: if (iczero) 47530, 7541, 47530 ! 283: 47530 if (ivcomp - 12) 27530,17530,27530 ! 284: 17530 ivpass = ivpass + 1 ! 285: write (i02,80001) ivtnum ! 286: go to 7541 ! 287: 27530 ivfail = ivfail + 1 ! 288: ivcorr = 12 ! 289: c actual answer is 11.25 truncation is necessary ! 290: c during an intermediate step ! 291: write (i02,80004) ivtnum, ivcomp, ivcorr ! 292: 7541 continue ! 293: ivtnum = 754 ! 294: c ! 295: c **** test 754 **** ! 296: c ! 297: if (iczero) 37540, 7540, 37540 ! 298: 7540 continue ! 299: ivon01 = 15 ! 300: ivon02 = 9 ! 301: ivon03 = 4 ! 302: ivon04 = 36 ! 303: ivon05 = 6 ! 304: ivon06 = 2 ! 305: ivcomp = ivon01 + (ivon02 - ivon03) * (ivon04 / ivon05) ** ivon06 ! 306: go to 47540 ! 307: 37540 ivdele = ivdele + 1 ! 308: write (i02,80003) ivtnum ! 309: if (iczero) 47540, 7551, 47540 ! 310: 47540 if (ivcomp - 195) 27540,17540,27540 ! 311: 17540 ivpass = ivpass + 1 ! 312: write (i02,80001) ivtnum ! 313: go to 7551 ! 314: 27540 ivfail = ivfail + 1 ! 315: ivcorr = 195 ! 316: write (i02,80004) ivtnum, ivcomp, ivcorr ! 317: 7551 continue ! 318: ivtnum = 755 ! 319: c ! 320: c **** test 755 **** ! 321: c ! 322: if (iczero) 37550, 7550, 37550 ! 323: 7550 continue ! 324: ivon01 = 15 ! 325: ivon02 = 9 ! 326: ivon03 = 4 ! 327: ivon04 = 36 ! 328: ivon05 = 6 ! 329: ivon06 = 2 ! 330: ivcomp = ((ivon01 + (ivon02 - ivon03) * ivon04) / ivon05) ** ! 331: * ivon06 ! 332: go to 47550 ! 333: 37550 ivdele = ivdele + 1 ! 334: write (i02,80003) ivtnum ! 335: if (iczero) 47550, 7561, 47550 ! 336: 47550 if (ivcomp - 1024) 27550,17550,27550 ! 337: 17550 ivpass = ivpass + 1 ! 338: write (i02,80001) ivtnum ! 339: go to 7561 ! 340: 27550 ivfail = ivfail + 1 ! 341: ivcorr = 1024 ! 342: c actual answer is 1056.25 truncation is necessary ! 343: c during an intermediate step ! 344: write (i02,80004) ivtnum, ivcomp, ivcorr ! 345: 7561 continue ! 346: ivtnum = 756 ! 347: c ! 348: c **** test 756 **** ! 349: c single parentheses ! 350: c ! 351: if (iczero) 37560, 7560, 37560 ! 352: 7560 continue ! 353: ivon01 = 13 ! 354: ivon02 = 37 ! 355: ivcomp = (ivon01 + ivon02) ! 356: go to 47560 ! 357: 37560 ivdele = ivdele + 1 ! 358: write (i02,80003) ivtnum ! 359: if (iczero) 47560, 7571, 47560 ! 360: 47560 if (ivcomp - 50) 27560,17560,27560 ! 361: 17560 ivpass = ivpass + 1 ! 362: write (i02,80001) ivtnum ! 363: go to 7571 ! 364: 27560 ivfail = ivfail + 1 ! 365: ivcorr = 50 ! 366: write (i02,80004) ivtnum, ivcomp, ivcorr ! 367: 7571 continue ! 368: ivtnum = 757 ! 369: c ! 370: c **** test 757 **** ! 371: c nested parentheses (two sets) ! 372: c ! 373: if (iczero) 37570, 7570, 37570 ! 374: 7570 continue ! 375: ivon01 = 13 ! 376: ivon02 = 37 ! 377: ivcomp = ((ivon01 - ivon02)) ! 378: go to 47570 ! 379: 37570 ivdele = ivdele + 1 ! 380: write (i02,80003) ivtnum ! 381: if (iczero) 47570, 7581, 47570 ! 382: 47570 if (ivcomp + 24) 27570,17570,27570 ! 383: 17570 ivpass = ivpass + 1 ! 384: write (i02,80001) ivtnum ! 385: go to 7581 ! 386: 27570 ivfail = ivfail + 1 ! 387: ivcorr = -24 ! 388: write (i02,80004) ivtnum, ivcomp, ivcorr ! 389: 7581 continue ! 390: ivtnum = 758 ! 391: c ! 392: c **** test 758 **** ! 393: c nested parentheses (21 sets - same line) ! 394: c ! 395: if (iczero) 37580, 7580, 37580 ! 396: 7580 continue ! 397: ivon01 = 13 ! 398: ivon02 = 37 ! 399: ivcomp = (((((((((((((((((((((ivon01 * ivon02))))))))))))))))))))) ! 400: go to 47580 ! 401: 37580 ivdele = ivdele + 1 ! 402: write (i02,80003) ivtnum ! 403: if (iczero) 47580, 7591, 47580 ! 404: 47580 if (ivcomp - 481) 27580,17580,27580 ! 405: 17580 ivpass = ivpass + 1 ! 406: write (i02,80001) ivtnum ! 407: go to 7591 ! 408: 27580 ivfail = ivfail + 1 ! 409: ivcorr = 481 ! 410: write (i02,80004) ivtnum, ivcomp, ivcorr ! 411: 7591 continue ! 412: ivtnum = 759 ! 413: c ! 414: c **** test 759 **** ! 415: c nested parentheses (57 sets - multiple lines) ! 416: c ! 417: if (iczero) 37590, 7590, 37590 ! 418: 7590 continue ! 419: ivon01 = 13 ! 420: ivon02 = 37 ! 421: ivcomp = ((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ! 422: * ivon01 / ivon02 ! 423: * ))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ! 424: go to 47590 ! 425: 37590 ivdele = ivdele + 1 ! 426: write (i02,80003) ivtnum ! 427: if (iczero) 47590, 7601, 47590 ! 428: 47590 if (ivcomp) 27590,17590,27590 ! 429: 17590 ivpass = ivpass + 1 ! 430: write (i02,80001) ivtnum ! 431: go to 7601 ! 432: 27590 ivfail = ivfail + 1 ! 433: ivcorr = 0 ! 434: write (i02,80004) ivtnum, ivcomp, ivcorr ! 435: 7601 continue ! 436: c ! 437: c write page footings and run summaries ! 438: 99999 continue ! 439: write (i02,90002) ! 440: write (i02,90006) ! 441: write (i02,90002) ! 442: write (i02,90002) ! 443: write (i02,90007) ! 444: write (i02,90002) ! 445: write (i02,90008) ivfail ! 446: write (i02,90009) ivpass ! 447: write (i02,90010) ivdele ! 448: c ! 449: c ! 450: c terminate routine execution ! 451: stop ! 452: c ! 453: c format statements for page headers ! 454: 90000 format (1h1) ! 455: 90002 format (1h ) ! 456: 90001 format (1h ,10x,34hfortran compiler validation system) ! 457: 90003 format (1h ,21x,11hversion 1.0) ! 458: 90004 format (1h ,10x,38hfor official use only - copyright 1978) ! 459: 90005 format (1h ,5x,4htest,5x,9hpass/fail, 5x,8hcomputed,8x,7hcorrect) ! 460: 90006 format (1h ,5x,46h----------------------------------------------) ! 461: 90011 format (1h ,18x,17hsubset level test) ! 462: c ! 463: c format statements for run summaries ! 464: 90008 format (1h ,15x,i5,19h errors encountered) ! 465: 90009 format (1h ,15x,i5,13h tests passed) ! 466: 90010 format (1h ,15x,i5,14h tests deleted) ! 467: c ! 468: c format statements for test results ! 469: 80001 format (1h ,4x,i5,7x,4hpass) ! 470: 80002 format (1h ,4x,i5,7x,4hfail) ! 471: 80003 format (1h ,4x,i5,7x,7hdeleted) ! 472: 80004 format (1h ,4x,i5,7x,4hfail,10x,i6,9x,i6) ! 473: 80005 format (1h ,4x,i5,7x,4hfail,4x,e12.5,3x,e12.5) ! 474: c ! 475: 90007 format (1h ,20x,20hend of program fm045) ! 476: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.