Annotation of 43BSDTahoe/usr.bin/f77/testf77/tests/fm004.f, revision 1.1

1.1     ! root        1: c     comment section
        !             2: c
        !             3: c     fm004
        !             4: c
        !             5: c         this routine contains basic arithmetic if statement tests.
        !             6: c     the statement format is
        !             7: c                if  (e)  k1, k2, k3
        !             8: c     where e is a simple integer expression of form
        !             9: c                variable - constant
        !            10: c                variable + constant
        !            11: c     and k1, k2 and k3 are statement labels.  only the statements in
        !            12: c     the basic assumptions are included in these tests.
        !            13: c         execution of an if statement causes evaluation of the
        !            14: c     expression e following which the statement label k1, k2 or k3
        !            15: c     is executed next as the value of e is less than zero, zero, or
        !            16: c     greater than zero, respectively.
        !            17: c
        !            18: c         the basic unconditional go to statement is tested in this
        !            19: c     routine. the statement is of the form
        !            20: c               go to k
        !            21: c     where k is a statement label.
        !            22: c         execution of an unconditional go to statement causes the
        !            23: c     statement identified by statement label k to be executed next.
        !            24: c
        !            25: c      references
        !            26: c        american national standard programming language fortran,
        !            27: c              x3.9-1978
        !            28: c
        !            29: c        section 3.6, normal execution sequence and transfer of control
        !            30: c        section 11.1, go to statement
        !            31: c        section 11.4, arithmetic if statement
        !            32: c
        !            33: c      **********************************************************
        !            34: c
        !            35: c         a compiler validation system for the fortran language
        !            36: c     based on specifications as defined in american national standard
        !            37: c     programming language fortran x3.9-1978, has been developed by the
        !            38: c     federal cobol compiler testing service.  the fortran compiler
        !            39: c     validation system (fcvs) consists of audit routines, their related
        !            40: c     data, and an executive system.  each audit routine is a fortran
        !            41: c     program, subprogram or function which includes tests of specific
        !            42: c     language elements and supporting procedures indicating the result
        !            43: c     of executing these tests.
        !            44: c
        !            45: c         this particular program/subprogram/function contains features
        !            46: c     found only in the subset as defined in x3.9-1978.
        !            47: c
        !            48: c         suggestions and comments should be forwarded to -
        !            49: c
        !            50: c                  department of the navy
        !            51: c                  federal cobol compiler testing service
        !            52: c                  washington, d.c.  20376
        !            53: c
        !            54: c      **********************************************************
        !            55: c
        !            56: c
        !            57: c
        !            58: c     initialization section
        !            59: c
        !            60: c     initialize constants
        !            61: c      **************
        !            62: c     i01 contains the logical unit number for the card reader.
        !            63:       i01 = 5
        !            64: c     i02 contains the logical unit number for the printer.
        !            65:       i02 = 6
        !            66: c     system environment section
        !            67: c
        !            68: cx010    this card is replaced by contents of fexec x-010 control card.
        !            69: c     the cx010 card is for overriding the program default i01 = 5
        !            70: c     (unit number for card reader).
        !            71: cx011    this card is replaced by contents of fexec x-011 control card.
        !            72: c     the cx011 card is for systems which require additional
        !            73: c     fortran statements for files associated with cx010 above.
        !            74: c
        !            75: cx020    this card is replaced by contents of fexec x-020 control card.
        !            76: c     the cx020 card is for overriding the program default i02 = 6
        !            77: c     (unit number for printer).
        !            78: cx021    this card is replaced by contents of fexec x-021 control card.
        !            79: c     the cx021 card is for systems which require additional
        !            80: c     fortran statements for files associated with cx020 above.
        !            81: c
        !            82:       ivpass=0
        !            83:       ivfail=0
        !            84:       ivdele=0
        !            85:       iczero=0
        !            86: c
        !            87: c     write page headers
        !            88:       write (i02,90000)
        !            89:       write (i02,90001)
        !            90:       write (i02,90002)
        !            91:       write (i02, 90002)
        !            92:       write (i02,90003)
        !            93:       write (i02,90002)
        !            94:       write (i02,90004)
        !            95:       write (i02,90002)
        !            96:       write (i02,90011)
        !            97:       write (i02,90002)
        !            98:       write (i02,90002)
        !            99:       write (i02,90005)
        !           100:       write (i02,90006)
        !           101:       write (i02,90002)
        !           102: c          test section
        !           103: c
        !           104: c         tests 21, 22, and 23 contain the same if statement but the
        !           105: c     expected branch is to the first, second or third statement label
        !           106: c     as the integer expression is less than zero, equal to zero, or
        !           107: c     greater than zero respectively.
        !           108: c
        !           109:   211 continue
        !           110:       ivtnum =  21
        !           111: c
        !           112: c      ****  test 021  ****
        !           113: c     test 21 - arithmetic if statement test
        !           114: c         less than zero branch expected.
        !           115: c
        !           116:       if (iczero) 30210,  210, 30210
        !           117:   210 continue
        !           118:       ivon01=2
        !           119:       if (ivon01 - 3) 212,213,214
        !           120:   212 ivon02 = -1
        !           121:       go to 40210
        !           122:   213 ivon02 = 0
        !           123:       go to 40210
        !           124:   214 ivon02 = 1
        !           125:       go to 40210
        !           126: 30210 ivdele = ivdele + 1
        !           127:       write (i02,80003) ivtnum
        !           128:       if (iczero) 40210,  221, 40210
        !           129: 40210 if (ivon02) 10210, 20210, 20210
        !           130: 10210 ivpass = ivpass + 1
        !           131:       write (i02,80001) ivtnum
        !           132:       go to  221
        !           133: 20210 ivfail = ivfail + 1
        !           134:       ivcomp=ivon02
        !           135:       ivcorr=-1
        !           136:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           137:   221 continue
        !           138:       ivtnum =  22
        !           139: c
        !           140: c      ****  test 022  ****
        !           141: c     test 22 - arithmetic if statement test
        !           142: c         equal to zero branch expected
        !           143: c
        !           144:       if (iczero) 30220,  220, 30220
        !           145:   220 continue
        !           146:       ivon01 = 3
        !           147:       if (ivon01 - 3) 222,223,224
        !           148:   222 ivon02 = -1
        !           149:       go to 40220
        !           150:   223 ivon02 = 0
        !           151:       go to 40220
        !           152:   224 ivon02 = 1
        !           153:       go to 40220
        !           154: 30220 ivdele = ivdele + 1
        !           155:       write (i02,80003) ivtnum
        !           156:       if (iczero) 40220,  231, 40220
        !           157: 40220 if (ivon02) 20220, 10220, 20220
        !           158: 10220 ivpass = ivpass + 1
        !           159:       write (i02,80001) ivtnum
        !           160:       go to  231
        !           161: 20220 ivfail = ivfail + 1
        !           162:       ivcomp=ivon02
        !           163:       ivcorr= 0
        !           164:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           165:   231 continue
        !           166:       ivtnum =  23
        !           167: c
        !           168: c      ****  test 023  ****
        !           169: c     test 23 - arithmetic if statement test
        !           170: c         greater than zero branch expected
        !           171: c
        !           172:       if (iczero) 30230,  230, 30230
        !           173:   230 continue
        !           174:       ivon01 = 4
        !           175:       if (ivon01 - 3) 232,233,234
        !           176:   232 ivon02 = -1
        !           177:       go to 40230
        !           178:   233 ivon02 = 0
        !           179:       go to 40230
        !           180:   234 ivon02 = 1
        !           181:       go to 40230
        !           182: 30230 ivdele = ivdele + 1
        !           183:       write (i02,80003) ivtnum
        !           184:       if (iczero) 40230,  241, 40230
        !           185: 40230 if (ivon02) 20230, 20230, 10230
        !           186: 10230 ivpass = ivpass + 1
        !           187:       write (i02,80001) ivtnum
        !           188:       go to  241
        !           189: 20230 ivfail = ivfail + 1
        !           190:       ivcomp=ivon02
        !           191:       ivcorr = 1
        !           192:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           193: c
        !           194: c         tests 24 through 29 contain an if statement with two of the
        !           195: c     three branch statement labels equal.
        !           196: c
        !           197:   241 continue
        !           198:       ivtnum =  24
        !           199: c
        !           200: c      ****  test 024  ****
        !           201: c     test 24 - arithmetic if statement test
        !           202: c         less than zero branch expected
        !           203: c
        !           204:       if (iczero) 30240,  240, 30240
        !           205:   240 continue
        !           206:       ivon01=2
        !           207:       if (ivon01 - 3) 242,243,242
        !           208:   242 ivon02=-1
        !           209:       go to 40240
        !           210:   243 ivon02=0
        !           211:       go to 40240
        !           212: 30240 ivdele = ivdele + 1
        !           213:       write (i02,80003) ivtnum
        !           214:       if (iczero) 40240,  251, 40240
        !           215: 40240 if (ivon02) 10240, 20240, 20240
        !           216: 10240 ivpass = ivpass + 1
        !           217:       write (i02,80001) ivtnum
        !           218:       go to  251
        !           219: 20240 ivfail = ivfail + 1
        !           220:       ivcomp=ivon02
        !           221:       ivcorr=-1
        !           222:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           223:   251 continue
        !           224:       ivtnum =  25
        !           225: c
        !           226: c      ****  test 025  ****
        !           227: c     test 25 - arithmetic if statement test
        !           228: c         equal to zero branch expected
        !           229: c
        !           230:       if (iczero) 30250,  250, 30250
        !           231:   250 continue
        !           232:       ivon01=3
        !           233:       if (ivon01 - 3) 252,253,252
        !           234:   252 ivon02= -1
        !           235:       go to 40250
        !           236:   253 ivon02 = 0
        !           237:       go to 40250
        !           238: 30250 ivdele = ivdele + 1
        !           239:       write (i02,80003) ivtnum
        !           240:       if (iczero) 40250,  261, 40250
        !           241: 40250 if (ivon02) 20250,10250,20250
        !           242: 10250 ivpass = ivpass + 1
        !           243:       write (i02,80001) ivtnum
        !           244:       go to  261
        !           245: 20250 ivfail = ivfail + 1
        !           246:       ivcomp=ivon02
        !           247:       ivcorr=0
        !           248:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           249:   261 continue
        !           250:       ivtnum =  26
        !           251: c
        !           252: c      ****  test 026  ****
        !           253: c     test 26 - arithmetic if statement test
        !           254: c         greater than zero branch expected
        !           255: c
        !           256:       if (iczero) 30260,  260, 30260
        !           257:   260 continue
        !           258:       ivon01=4
        !           259:       if (ivon01-3) 262, 263, 262
        !           260:   262 ivon02= 1
        !           261:       go to 40260
        !           262:   263 ivon02 = 0
        !           263:       go to 40260
        !           264: 30260 ivdele = ivdele + 1
        !           265:       write (i02,80003) ivtnum
        !           266:       if (iczero) 40260,  271, 40260
        !           267: 40260 if (ivon02) 20260, 20260, 10260
        !           268: 10260 ivpass = ivpass + 1
        !           269:       write (i02,80001) ivtnum
        !           270:       go to  271
        !           271: 20260 ivfail = ivfail + 1
        !           272:       ivcomp=ivon02
        !           273:       ivcorr = 1
        !           274:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           275:   271 continue
        !           276:       ivtnum =  27
        !           277: c
        !           278: c      ****  test 027  ****
        !           279: c     test 27 - arithmetic if statement test
        !           280: c         less than zero branch expected
        !           281: c
        !           282:       if (iczero) 30270,  270, 30270
        !           283:   270 continue
        !           284:       ivon01 = -4
        !           285:       if (ivon01 + 3) 272, 272, 273
        !           286:   272 ivon02= -1
        !           287:       go to 40270
        !           288:   273 ivon02 = 1
        !           289:       go to 40270
        !           290: 30270 ivdele = ivdele + 1
        !           291:       write (i02,80003) ivtnum
        !           292:       if (iczero) 40270,  281, 40270
        !           293: 40270 if (ivon02) 10270, 20270, 20270
        !           294: 10270 ivpass = ivpass + 1
        !           295:       write (i02,80001) ivtnum
        !           296:       go to  281
        !           297: 20270 ivfail = ivfail + 1
        !           298:       ivcomp=ivon02
        !           299:       ivcorr= -1
        !           300:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           301:   281 continue
        !           302:       ivtnum =  28
        !           303: c
        !           304: c      ****  test 028  ****
        !           305: c     test 28 - arithmetic if statement test
        !           306: c         equal to zero branch expected
        !           307: c
        !           308:       if (iczero) 30280,  280, 30280
        !           309:   280 continue
        !           310:       ivon01 = -3
        !           311:       if (ivon01 + 3) 282, 282, 283
        !           312:   282 ivon02 = 0
        !           313:       go to 40280
        !           314:   283 ivon02 = 1
        !           315:       go to 40280
        !           316: 30280 ivdele = ivdele + 1
        !           317:       write (i02,80003) ivtnum
        !           318:       if (iczero) 40280,  291, 40280
        !           319: 40280 if (ivon02) 20280, 10280, 20280
        !           320: 10280 ivpass = ivpass + 1
        !           321:       write (i02,80001) ivtnum
        !           322:       go to  291
        !           323: 20280 ivfail = ivfail + 1
        !           324:       ivcomp=ivon02
        !           325:       ivcorr= 0
        !           326:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           327:   291 continue
        !           328:       ivtnum =  29
        !           329: c
        !           330: c      ****  test 029  ****
        !           331: c     test 29 - arithmetic if statement test
        !           332: c         greater than zero branch expected
        !           333: c
        !           334:       if (iczero) 30290,  290, 30290
        !           335:   290 continue
        !           336:       ivon01 = -2
        !           337:       if (ivon01 + 3) 292,292,293
        !           338:   292 ivon02 = -1
        !           339:       go to 40290
        !           340:   293 ivon02 = 1
        !           341:       go to 40290
        !           342: 30290 ivdele = ivdele + 1
        !           343:       write (i02,80003) ivtnum
        !           344:       if (iczero) 40290,  301, 40290
        !           345: 40290 if (ivon02) 20290, 20290, 10290
        !           346: 10290 ivpass = ivpass + 1
        !           347:       write (i02,80001) ivtnum
        !           348:       go to  301
        !           349: 20290 ivfail = ivfail + 1
        !           350:       ivcomp= ivon02
        !           351:       ivcorr = 1
        !           352:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           353: c
        !           354: c         tests 30 and 31 contain the basic go to statement tests.
        !           355: c
        !           356:   301 continue
        !           357:       ivtnum =  30
        !           358: c
        !           359: c      ****  test 030  ****
        !           360: c     test 30 - unconditional go to statement test
        !           361: c
        !           362:       if (iczero) 30300,  300, 30300
        !           363:   300 continue
        !           364:       ivon01 = 1
        !           365:       go to 302
        !           366:   303 ivon01 = 2
        !           367:       go to 304
        !           368:   302 ivon01 = 3
        !           369:       go to 303
        !           370:   304 go to 40300
        !           371: 30300 ivdele = ivdele + 1
        !           372:       write (i02,80003) ivtnum
        !           373:       if (iczero) 40300,  311, 40300
        !           374: 40300 if (ivon01 - 2) 20300,10300,20300
        !           375: 10300 ivpass = ivpass + 1
        !           376:       write (i02,80001) ivtnum
        !           377:       go to  311
        !           378: 20300 ivfail = ivfail + 1
        !           379:       ivcomp = ivon01
        !           380:       ivcorr = 2
        !           381:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           382:   311 continue
        !           383:       ivtnum =  31
        !           384: c
        !           385: c      ****  test 031  ****
        !           386: c     test 31 - unconditional go to statement test
        !           387: c
        !           388:       if (iczero) 30310,  310, 30310
        !           389:   310 continue
        !           390:       ivon01 = 1
        !           391:       go to 316
        !           392:   313 go to 317
        !           393:   314 ivon01 = 3
        !           394:       go to 40310
        !           395:   315 go to 313
        !           396:   316 go to 315
        !           397:   317 go to 314
        !           398: 30310 ivdele = ivdele + 1
        !           399:       write (i02,80003) ivtnum
        !           400:       if (iczero) 40310,  321, 40310
        !           401: 40310 if (ivon01 - 3) 20310, 10310, 20310
        !           402: 10310 ivpass = ivpass + 1
        !           403:       write (i02,80001) ivtnum
        !           404:       go to  321
        !           405: 20310 ivfail = ivfail + 1
        !           406:       ivcomp=ivon01
        !           407:       ivcorr = 3
        !           408:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           409:   321 continue
        !           410:       ivtnum =  32
        !           411: c
        !           412: c      ****  test 032  ****
        !           413: c         test 32 - arithmetic if statement and unconditional go to
        !           414: c                   statement
        !           415: c     this test combines the basic arithmetic if statements and
        !           416: c     unconditional go to statements in one test.
        !           417: c
        !           418:       if (iczero) 30320,  320, 30320
        !           419:   320 continue
        !           420:       ivon01 = 1
        !           421:       go to 322
        !           422:   324 ivon01 = 2
        !           423:       if (ivon01 -1) 323, 323, 325
        !           424:   327 ivon01 = 5
        !           425:       go to 328
        !           426:   326 ivon01 = -4
        !           427:       if (ivon01 + 4) 323, 327, 323
        !           428:   322 if (ivon01 - 1) 323, 324, 323
        !           429:   323 go to 20320
        !           430:   325 ivon01 = 3
        !           431:       if (ivon01 -4) 326,323,323
        !           432:   328 go to 40320
        !           433: 30320 ivdele = ivdele + 1
        !           434:       write (i02,80003) ivtnum
        !           435:       if (iczero) 40320,  331, 40320
        !           436: 40320 if (ivon01 - 5) 20320, 10320, 20320
        !           437: 10320 ivpass = ivpass + 1
        !           438:       write (i02,80001) ivtnum
        !           439:       go to  331
        !           440: 20320 ivfail = ivfail + 1
        !           441:       ivcomp=ivon01
        !           442:       ivcorr=5
        !           443:       write (i02,80004) ivtnum, ivcomp ,ivcorr
        !           444:   331 continue
        !           445: c
        !           446: c     write page footings and run summaries
        !           447: 99999 continue
        !           448:       write (i02,90002)
        !           449:       write (i02,90006)
        !           450:       write (i02,90002)
        !           451:       write (i02,90002)
        !           452:       write (i02,90007)
        !           453:       write (i02,90002)
        !           454:       write (i02,90008)  ivfail
        !           455:       write (i02,90009) ivpass
        !           456:       write (i02,90010) ivdele
        !           457: c
        !           458: c
        !           459: c     terminate routine execution
        !           460:       stop
        !           461: c
        !           462: c     format statements for page headers
        !           463: 90000 format (1h1)
        !           464: 90002 format (1h )
        !           465: 90001 format (1h ,10x,34hfortran compiler validation system)
        !           466: 90003 format (1h ,21x,11hversion 1.0)
        !           467: 90004 format (1h ,10x,38hfor official use only - copyright 1978)
        !           468: 90005 format (1h ,5x,4htest,5x,9hpass/fail, 5x,8hcomputed,8x,7hcorrect)
        !           469: 90006 format (1h ,5x,46h----------------------------------------------)
        !           470: 90011 format (1h ,18x,17hsubset level test)
        !           471: c
        !           472: c     format statements for run summaries
        !           473: 90008 format (1h ,15x,i5,19h errors encountered)
        !           474: 90009 format (1h ,15x,i5,13h tests passed)
        !           475: 90010 format (1h ,15x,i5,14h tests deleted)
        !           476: c
        !           477: c     format statements for test results
        !           478: 80001 format (1h ,4x,i5,7x,4hpass)
        !           479: 80002 format (1h ,4x,i5,7x,4hfail)
        !           480: 80003 format (1h ,4x,i5,7x,7hdeleted)
        !           481: 80004 format (1h ,4x,i5,7x,4hfail,10x,i6,9x,i6)
        !           482: 80005 format (1h ,4x,i5,7x,4hfail,4x,e12.5,3x,e12.5)
        !           483: c
        !           484: 90007 format (1h ,20x,20hend of program fm004)
        !           485:       end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.