brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · d536e16 Raw
139 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12  character(len=20) :: access = "direcT"3  character(len=20) :: access_(2) = (/"direcT", "streaM"/)4  character(len=20) :: action_(2) = (/"reaD ", "writE"/)5  character(len=20) :: asynchronous_(2) = (/"nO ", "yeS"/)6  character(len=20) :: blank_(2) = (/"nulL", "zerO"/)7  character(len=20) :: decimal_(2) = (/'commA', 'poinT'/)8  character(len=20) :: delim_(2) = (/"nonE ", "quotE"/)9  character(len=20) :: encoding_(2) = (/"defaulT", "utF-8  "/)10  character(len=20) :: form_(2) = (/"formatteD  ", "unformatteD"/)11  character(len=20) :: pad_(2) = (/"nO ", "yeS"/)12  character(len=20) :: position_(3) = (/"appenD", "asiS  ", "rewinD"/)13  character(len=20) :: round_(2) = (/"dowN", "zerO"/)14  character(len=20) :: sign_(2) = (/"pluS    ", "suppresS"/)15  character(len=20) :: status_(2) = (/"neW", "olD"/)16  character(len=20) :: convert_(2) = (/"big_endiaN", "nativE    "/)17  character(len=20) :: dispose_(2) = (/ "deletE", "keeP  "/)18  character(len=66) :: cc, msg19 20  integer :: new_unit21  integer :: unit10 = 1022  integer :: unit11 = 1123  integer :: n = 4024  integer, parameter :: const_new_unit = 6625 26  integer(kind=1) :: stat127  integer(kind=2) :: stat228  integer(kind=4) :: stat429  integer(kind=8) :: stat830 31  cc = 'scratch'32 33  open(unit10)34  open(blank='null', unit=unit10, pad='no')35  open(unit=unit11, err=3)363 continue37 38  open(20, access='sequential')39  open(21, access=access, recl=n)40  open(22, access=access_(2), iostat=stat1, iomsg=msg)41 42  open(30, action='readwrite', asynchronous='n'//'o', blank='zero')43  open(31, action=action_(2), asynchronous=asynchronous_(2), blank=blank_(2))44 45  open(unit=40, decimal="comma", delim="apostrophe", encoding="utf-8")46  open(unit=41, decimal=decimal_(2), delim=delim_(2), encoding=encoding_(2))47 48  open(50, file='abc', status='unknown', form='formatted')49  open(51, file=access, status=status_(2), form=form_(2))50 51  open(newunit=new_unit, pad=pad_(2), status='scr'//'atch'//'')52  open(newunit=new_unit, pad=pad_(2), status=cc)53 54  open(unit=60, position='rewind', recl=(30+20/2), round='zero')55  open(position=position_(1), recl=n, round=round_(2), unit=61)56 57  open(unit=70, sign='suppress', &58      status='unknown', iostat=stat2)59  open(unit=70, sign=sign_(2), status=status_(2))60 61  open(80, convert='big_endian', dispose='delete')62  open(81, convert=convert_(2), dispose=dispose_(2))63 64  open(access='STREAM', 90) ! nonstandard65  open (unit=91, file='xfile', carriagecontrol='list') ! nonstandard66 67  !ERROR: OPEN statement must have a UNIT or NEWUNIT specifier68  !ERROR: If ACCESS='DIRECT' appears, RECL must also appear69  open(access='direct')70 71  !ERROR: If STATUS='STREAM' appears, RECL must not appear72  open(10, access='st'//'ream', recl=13)73 74  !ERROR: Duplicate NEWUNIT specifier75  !ERROR: If NEWUNIT appears, FILE or STATUS must also appear76  open(newunit=n, newunit=nn, iostat=stat4)77 78  !ERROR: NEWUNIT variable 'const_new_unit' is not definable79  !BECAUSE: '66_4' is not a variable or pointer80  open(newunit=const_new_unit, status=cc)81 82  !ERROR: Duplicate UNIT specifier83  open(unit=100, unit=100)84 85  !ERROR: Duplicate UNIT specifier86  open(101, delim=delim_(1), unit=102)87 88  !ERROR: Duplicate UNIT specifier89  open(unit=103, &90      unit=104, iostat=stat8)91 92  !ERROR: Duplicate UNIT specifier93  !ERROR: If ACCESS='DIRECT' appears, RECL must also appear94  open(access='dir'//'ect', 9, 9) ! nonstandard95 96  !ERROR: Duplicate ROUND specifier97  open(105, round=round_(1), pad='no', round='nearest')98 99  !ERROR: If NEWUNIT appears, UNIT must not appear100  !ERROR: If NEWUNIT appears, FILE or STATUS must also appear101  open(106, newunit=n)102 103  !ERROR: RECL value (-30) must be positive104  open(107, recl=40-70)105 106  !ERROR: RECL value (-36) must be positive107  open(108, recl=-  -  (-36)) ! nonstandard108 109  !ERROR: Invalid ACTION value 'reedwrite'110  open(109, access=Access, action='reedwrite', recl=77)111 112  !ERROR: Invalid ACTION value 'nonsense'113  open(110, action=''//'non'//'sense', recl=77)114 115  !ERROR: Invalid STATUS value 'cold'116  open(111, status='cold')117 118  !ERROR: Invalid STATUS value 'Keep'119  open(112, status='Keep')120 121  !ERROR: If STATUS='NEW' appears, FILE must also appear122  open(113, status='new')123 124  !ERROR: If STATUS='REPLACE' appears, FILE must also appear125  open(114, status='replace')126 127  !ERROR: If STATUS='SCRATCH' appears, FILE must not appear128  open(115, file='abc', status='scratch')129 130  !ERROR: If NEWUNIT appears, FILE or STATUS='SCRATCH' must also appear131  open(newunit=nn, status='old')132 133  !ERROR: Unimplemented CARRIAGECONTROL value 'fortran'134  open (unit=116, file='xfile', carriagecontrol='fortran') ! nonstandard135 136  !ERROR: Invalid CARRIAGECONTROL value 'nonsense'137  open (unit=116, file='xfile', carriagecontrol='nonsense') ! nonstandard138end139