brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · bef0d6d Raw
70 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12  character*20 c(25), cv3  character(kind=1,len=59) msg4  character, parameter :: const_round = "c'est quoi?"5  logical*2 v(5), lv6  integer*1 stat17  integer*2 stat48  integer*8 stat8, iv9  integer, parameter :: const_id = 110 11  inquire(10)12  inquire(file='abc')13  inquire(10, pos=ipos, iomsg=msg, iostat=stat1)14  inquire(file='abc', &15      access=c(1), action=c(2), asynchronous=c(3), blank=c(4), decimal=c(5), &16      delim=c(6), direct=c(7), encoding=c(8), form=c(9), formatted=c(10), &17      name=c(11), pad=c(12), position=c(13), read=c(14), readwrite=c(15), &18      round=c(16), sequential=c(17), sign=c(18), stream=c(19), &19      unformatted=c(20), write=c(21), &20      err=9, &21      nextrec=nextrec, number=number, pos=jpos, recl=jrecl, size=jsize, &22      iomsg=msg, &23      iostat=stat4, &24      exist=v(1), named=v(2), opened=v(3), pending=v(4))25  inquire(pending=v(5), file='abc')26  inquire(10, id=id, pending=v(5))27  inquire(10, id=const_id, pending=v(5))28  inquire(10, carriagecontrol=c(1)) ! nonstandard29 30  ! using variable 'cv' multiple times seems to be allowed31  inquire(file='abc', &32      access=cv, action=cv, asynchronous=cv, blank=cv, decimal=cv, &33      delim=cv, direct=cv, encoding=cv, form=cv, formatted=cv, &34      name=cv, pad=cv, position=cv, read=cv, readwrite=cv, &35      round=cv, sequential=cv, sign=cv, stream=cv, &36      unformatted=cv, write=cv, &37      nextrec=iv, number=iv, pos=iv, recl=iv, size=iv, &38      exist=lv, named=lv, opened=lv, pending=lv)39 40  !ERROR: INQUIRE statement must have a UNIT number or FILE specifier41  inquire(err=9)42 43  !ERROR: If FILE appears, UNIT must not appear44  inquire(10, file='abc', blank=c(22), iostat=stat8)45 46  !ERROR: Duplicate FILE specifier47  inquire(file='abc', file='xyz')48 49  !ERROR: Duplicate FORM specifier50  inquire(form=c(1), iostat=stat1, form=c(2), file='abc')51 52  !ERROR: Duplicate SIGN specifier53  !ERROR: Duplicate READ specifier54  !ERROR: Duplicate WRITE specifier55  inquire(1, read=c(1), write=c(2), sign=c(3), sign=c(4), read=c(5), write=c(1))56 57  !ERROR: Duplicate IOMSG specifier58  !WARNING: IOMSG= is useless without either ERR= or IOSTAT=59  inquire(10, iomsg=msg, pos=ipos, iomsg=msg)60 61  !ERROR: If ID appears, PENDING must also appear62  inquire(file='abc', id=id)63 64  !ERROR: ROUND variable 'const_round' is not definable65  !BECAUSE: '"c"' is not a variable or pointer66  inquire(file='abc', round=const_round)67 689 continue69end70