1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
4 character(kind
=1,len
=59) msg
5 character, parameter :: const_round
= "c'est quoi?"
10 integer, parameter :: const_id
= 1
14 inquire(10, pos
=ipos
, iomsg
=msg
, iostat
=stat1
)
16 access
=c(1), action
=c(2), asynchronous
=c(3), blank
=c(4), decimal
=c(5), &
17 delim
=c(6), direct
=c(7), encoding
=c(8), form
=c(9), formatted
=c(10), &
18 name
=c(11), pad
=c(12), position
=c(13), read=c(14), readwrite
=c(15), &
19 round
=c(16), sequential
=c(17), sign
=c(18), stream
=c(19), &
20 unformatted
=c(20), write=c(21), &
22 nextrec
=nextrec
, number
=number
, pos
=jpos
, recl
=jrecl
, size
=jsize
, &
25 exist
=v(1), named
=v(2), opened
=v(3), pending
=v(4))
26 inquire(pending
=v(5), file
='abc')
27 inquire(10, id
=id
, pending
=v(5))
28 inquire(10, id
=const_id
, pending
=v(5))
29 inquire(10, carriagecontrol
=c(1)) ! nonstandard
31 ! using variable 'cv' multiple times seems to be allowed
33 access
=cv
, action
=cv
, asynchronous
=cv
, blank
=cv
, decimal
=cv
, &
34 delim
=cv
, direct
=cv
, encoding
=cv
, form
=cv
, formatted
=cv
, &
35 name
=cv
, pad
=cv
, position
=cv
, read=cv
, readwrite
=cv
, &
36 round
=cv
, sequential
=cv
, sign
=cv
, stream
=cv
, &
37 unformatted
=cv
, write=cv
, &
38 nextrec
=iv
, number
=iv
, pos
=iv
, recl
=iv
, size
=iv
, &
39 exist
=lv
, named
=lv
, opened
=lv
, pending
=lv
)
41 !ERROR: INQUIRE statement must have a UNIT number or FILE specifier
44 !ERROR: If FILE appears, UNIT must not appear
45 inquire(10, file
='abc', blank
=c(22), iostat
=stat8
)
47 !ERROR: Duplicate FILE specifier
48 inquire(file
='abc', file
='xyz')
50 !ERROR: Duplicate FORM specifier
51 inquire(form
=c(1), iostat
=stat1
, form
=c(2), file
='abc')
53 !ERROR: Duplicate SIGN specifier
54 !ERROR: Duplicate READ specifier
55 !ERROR: Duplicate WRITE specifier
56 inquire(1, read=c(1), write=c(2), sign
=c(3), sign
=c(4), read=c(5), write=c(1))
58 !ERROR: Duplicate IOMSG specifier
59 inquire(10, iomsg
=msg
, pos
=ipos
, iomsg
=msg
)
61 !ERROR: If ID appears, PENDING must also appear
62 inquire(file
='abc', id
=id
)
64 !ERROR: ROUND variable 'const_round' must be definable
65 inquire(file
='abc', round
=const_round
)